A vehicle image processing method, apparatus, device and medium

By generating a sampling pool of the sample training set and dividing the sampling period and sub-period, we ensure that each type of image samples is uniformly collected, solving the sampling imbalance caused by random sampling and improving the performance of the image recognition model.

CN115565032BActive Publication Date: 2025-05-27BEIJING TRUNK TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211328542.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-26
Publication Date
2025-05-27
Estimated Expiration
2042-10-26

AI Technical Summary

Technical Problem

In the prior art, when processing mixed samples, random sampling is likely to lead to uneven sampling, resulting in better learning effects on the feature of a few samples, and poor learning effects on the feature of most samples, affecting the performance of the model.

Method used

The sampling ratio is determined by generating a sampling pool of the sample training set and based on the proportion of the number of image samples in each sampling pool that occupies the total number of samples. Then, using a larger first sample number and a smaller second sample number, the sampling period and sub-period are divided to ensure that each type of image sample is uniformly collected within each sampling period.

Benefits of technology

Through this method, the sampling imbalance caused by random sampling is avoided, the learning effect of the image recognition model on image features of various sample types is improved, and the model performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115565032B_ABST
    Figure CN115565032B_ABST
Patent Text Reader

Abstract

The present application provides a vehicle image processing method, apparatus, device and medium. The method includes: obtaining a sample training set and generating a sampling pool of the sample training set; determining a sampling ratio corresponding to each sampling pool; determining a first sampling number corresponding to each sampling period and a second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number; determining a second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number and the sampling ratio corresponding to each sampling pool; for each sampling pool, periodically sampling the image samples in the sampling pool according to the second sub-sampling number corresponding to the sub-period; generating a training subset according to the image samples collected from each sampling pool in each sub-period, and training the image recognition model to be trained according to the training subset. The method of the present application improves the balance of data sampling, thereby improving the model performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and particularly to a vehicle image processing method, apparatus, device and medium, which can be applied to scenarios such as ports, highways, logistics, mines, closed parks, or urban traffic. Background Art

[0002] With the development of science and technology, deep learning technology has been widely applied in various fields of society, such as autonomous driving, industrial security, and smart home.

[0003] Currently, the mainstream deep learning technology is supervised learning, that is, first use a set of training samples with labels to train the model so that the model learns certain performance, and then use this model to predict new samples. Due to the needs of actual business, the model obtained based on supervised learning may need to have the performance of classifying or recognizing multiple image features. Therefore, when training the model, multiple image samples with different labels, that is, mixed samples, are required, and the number of samples of different label types may not be consistent, or even have a large gap. For the above-mentioned mixed samples, the data sampling process in the prior art is usually random sampling, that is, after the terminal device obtains the training sample set, it will randomly grab a certain number of image samples from the training sample set and input the grabbed image samples into the image model to be trained for model training. Through periodic random sampling, all the image samples in the training sample set will be input into the image model to be trained, so that the image model can learn corresponding image recognition, classification and other performances. However, when the training samples are mixed samples and the number of different types of training samples varies greatly, that is, the quantity is unbalanced, random sampling will cause the problem of unbalanced sampling, that is, in the early stage of sampling, only the image samples of the type with the largest number may be collected. Unbalanced sampling may cause the trained image model to have a good learning effect only on the image features with a large number of samples, while having a very poor learning effect on other image features, thus affecting the model performance.

[0004] Therefore, a vehicle image processing solution that can sample more evenly and thus improve the model performance is needed. Summary of the Invention

[0005] This application provides a vehicle image processing method, apparatus, device and medium to solve the technical problem that the existing image processing has unbalanced sampling and poor model performance.

[0006] In a first aspect, this application provides a vehicle image processing method, including:

[0007] Obtain a sample training set, and generate a sampling pool of the sample training set according to the sample types of each image sample in the sample training set;

[0008] Determine the sampling ratio corresponding to each sampling pool according to the proportion of the number of image samples in each sampling pool in the total number of samples in the sample training set;

[0009] Determine the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number;

[0010] Determine the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool;

[0011] For each sampling pool, sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period;

[0012] Generate a training subset according to the image samples collected from each sampling pool in each sub-period, and train the image recognition model to be trained according to the training subset, where the image recognition model is used to recognize the image features corresponding to the sample type in the image.

[0013] In this embodiment, a sampling pool of the sample training set can be generated first according to the sample types of each image sample in the sample training set, that is, each image sample is placed by type; then, according to the proportion of the number of image samples in each sampling pool to the total number of samples in the sample training set, the sampling ratio corresponding to each sampling pool is determined. By sampling according to the sampling ratio, image samples of each type can be collected within one sampling period, thus avoiding the problem of unbalanced sampling caused by random sampling and improving the learning effect of the image recognition model on the image features corresponding to each sample type. Further, since the sampling ratio usually cannot be divided exactly, a certain sampling error will be generated in each sampling period. When the number of samples is very large, if sampling is directly performed with a relatively small number magnitude, the sampling error will accumulate greatly, resulting in the remaining image samples in the late stage of sampling being of the same sample type. Therefore, after determining the sampling ratio corresponding to each sampling pool, the first sampling number with a relatively large number magnitude can be used as the sampling number for each sampling period to avoid the remaining image samples in the late stage of sampling being of the same sample type and further avoid the problem of unbalanced sampling, thereby improving the performance of the image recognition model. Further, when sampling each sampling period with the first sampling number with a relatively large number magnitude, due to the large sampling number, it may cause the image samples of the sample type with the largest number to appear concentratedly in each sampling period, thus affecting the learning effect of the image recognition model. Therefore, for each sampling period, multiple sub-periods are further divided, and the second sampling number with a relatively small number magnitude is used as the sampling number for each sub-period to avoid the concentrated appearance of image samples of the same sample type in each sampling period and further avoid the problem of unbalanced sampling, thereby improving the performance of the image recognition model. After dividing the sub-periods for each sampling period, the second sub-sampling number of each sampling pool in each sub-period can be determined according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; for each sampling pool, the image samples in the sampling pool are sampled periodically according to the second sub-sampling number corresponding to the sub-period. Through such a setting, the training subset generated from the image samples collected from each sampling pool in each sub-period not only conforms to the sampling ratio but also ensures sampling balance, enabling the image recognition model trained according to this training subset to well possess the performance of recognizing the image features corresponding to the above sample types in the image.

[0014] In a possible implementation manner, the determining the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool specifically includes:

[0015] Determining the first sub-sampling number of each sampling pool in each sampling period according to the first sampling number and the sampling ratio corresponding to each sampling pool;

[0016] Determine the second sub-sampling number of each sampling pool in each sub-period according to the first sub-sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool.

[0017] In this embodiment, after determining the first sampling number corresponding to each sampling period and the sampling ratio corresponding to each sampling pool, the first sub-sampling number of each sampling pool in each sampling period can be simply and accurately determined accordingly, thereby improving the balance of the sampling number in each sampling period. After determining the second sampling number corresponding to each sub-period and the sampling ratio corresponding to each sampling pool, the standard sub-sampling number of each sampling pool in each sub-period can be simply and conveniently determined accordingly. Since the sampling ratio usually cannot be divided exactly, the first sub-sampling number may not be an integer multiple of the standard sub-sampling number. Therefore, it is necessary to adjust the standard sub-sampling number by using the first sub-sampling number to obtain the second sub-sampling number of each sampling pool in each sub-period. Through such a setting, the second sub-sampling number of each sampling pool in each sub-period finally obtained can be more balanced, further improving the balance of sampling, and thus improving the performance of the image recognition model.

[0018] In a possible implementation manner, the determining the first sub-sampling number of each sampling pool in each sampling period according to the first sampling number and the sampling ratio corresponding to each sampling pool specifically includes:

[0019] Simplify the sampling ratio corresponding to each sampling pool according to the first sampling number to obtain the first sampling ratio corresponding to each sampling pool;

[0020] Determine the first standard sub-sampling number of each sampling pool in the sampling period according to the first sampling number and the first sampling ratio corresponding to each sampling pool;

[0021] For each sampling pool, judge whether there is an end sampling period in the sampling period where the remaining sample number is less than the first standard sub-sampling number according to the number of all image samples in the sampling pool;

[0022] If so, determine the first actual sub-sampling number of each sampling pool in the end sampling period according to the remaining sample number in the end sampling period; determine the first sub-sampling number of each sampling pool in each sampling period according to the first actual sub-sampling number of each sampling pool in the end sampling period and the first standard sub-sampling number of each sampling pool in other sampling periods except the end sampling period;

[0023] If not, determine the first subsampling number of each sampling pool in each sampling period according to the first standard subsampling number of each sampling pool in the sampling period.

[0024] In this embodiment, since the sampling ratio may not be divisible exactly, first, it is necessary to simplify the sampling ratio corresponding to each sampling pool according to the first sampling number to obtain the first sampling ratio corresponding to each sampling pool, so that the first subsampling numbers obtained according to the first sampling ratio are more balanced, avoiding that the remaining image samples at the end of the sampling period are all of the same sample type, and further avoiding the problem of unbalanced sampling. Further, for each sampling pool, when the number of all image samples in the sampling pool is not an integer multiple of the first standard subsampling number, there will be an end sampling period with the remaining sample number less than the first standard subsampling number. At this time, the first actual subsampling number of each sampling pool in the end sampling period can be determined according to the remaining sample number in the end sampling period. When there is an end sampling period, the first subsampling number of each sampling pool in each sampling period can be determined according to the first actual subsampling number and the first standard subsampling number. Through such a setting, the first subsampling number of each sampling pool in each sampling period can be determined more accurately, improving the accuracy of the first subsampling number and also improving the accuracy of determining the second subsampling number using the first subsampling number.

[0025] In a possible implementation manner, the determining the second subsampling number of each sampling pool in each sub-period according to the first subsampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool specifically includes:

[0026] Simplify the sampling ratio corresponding to each sampling pool according to the second sampling number to obtain the second sampling ratio corresponding to each sampling pool;

[0027] Determine the second standard subsampling number of each sampling pool in each sub-period according to the second sampling number and the second sampling ratio corresponding to each sampling pool;

[0028] For each sampling pool, judge whether there is an end sub-period with the remaining sample number less than the second standard subsampling number in the sampling period where the sub-period is located according to the first subsampling number;

[0029] If so, determine the second actual sub-sampling number of each sampling pool in the terminal sub-period according to the remaining sample number in the terminal sub-period; determine the second sub-sampling number of each sampling pool in each sub-period according to the second actual sub-sampling number of each sampling pool in the terminal sub-period and the second standard sub-sampling number of each sampling pool in other sub-periods except the terminal sub-period;

[0030] If not, determine the second sub-sampling number of each sampling pool in each sub-period according to the second standard sub-sampling number of each sampling pool in the sub-period.

[0031] In this embodiment, since the sampling ratio may not be divisible exactly, it is first necessary to simplify the sampling ratio corresponding to each sampling pool according to the second sampling number to obtain the second sampling ratio corresponding to each sampling pool, so that the second sub-sampling number obtained according to the second sampling ratio is more balanced, avoiding the concentration of image samples of the same sample type in each sampling cycle, and further avoiding the problem of unbalanced sampling. Further, for each sampling pool, when the first sub-sampling number in the sampling cycle is not an integer multiple of the second standard sub-sampling number, there will be a terminal sub-period with a remaining sample number less than the second standard sub-sampling number. At this time, the second actual sub-sampling number of each sampling pool in the terminal sub-period can be determined according to the remaining sample number in the terminal sub-period. When there is a terminal sub-period, the second sub-sampling number of each sampling pool in each sub-period can be determined according to the second actual sub-sampling number and the second standard sub-sampling number. Through such a setting, the second sub-sampling number of each sampling pool in each sub-period can be determined more accurately, improving the accuracy of the second sub-sampling number, and also improving the balance and accuracy of periodic sampling using the second sub-sampling number.

[0032] In a possible implementation manner, for each sampling pool, periodically sampling the image samples in the sampling pool according to the second sub-sampling number corresponding to the sub-period specifically includes:

[0033] For each sampling pool, periodically sample the image samples in the sampling pool according to the second sub-sampling number corresponding to the sub-period until the sampling of the current sampling cycle where the sub-period is located is completed;

[0034] According to the second sub-sampling numbers corresponding to the sub-periods in the next sampling cycle of the current sampling cycle, periodically sample the image samples in the sampling pool until all sampling cycles are completed, so that all the image samples in the sampling pool are collected.

[0035] In this embodiment, the sampling of a sampling period can be completed by continuously cycling through sub - periods, and then the sampling of all image samples can be completed by continuously cycling through the sampling periods. With such a setting, the sampling of all image samples in each sampling pool can be completed simply and orderly, further improving the balance of sampling.

[0036] In one possible implementation manner, generating the sampling pools of the sample training set according to the sample types of the image samples in the sample training set specifically includes:

[0037] Determine the sample types corresponding to the sample training set according to the type labels of the image samples in the sample training set;

[0038] Establish sampling pools corresponding to each of the sample types, and respectively put the image samples in the sample training set into the corresponding sampling pools according to the type labels.

[0039] In this embodiment, since the image samples all carry type labels, therefore, according to the type labels of the image samples in the sample training set, the sample types corresponding to the sample training set can be simply and accurately determined. Since the sample types correspond one - to - one with the sampling pools, and the type labels correspond one - to - one with the sample types, therefore, after establishing the sampling pools corresponding to each sample type, the image samples can be simply and accurately put into the corresponding sampling pools according to the type labels.

[0040] In one possible implementation manner, determining the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub - period of the sampling period specifically includes:

[0041] Determine the first sampling number corresponding to each sampling period according to the total number of samples in the sample training set;

[0042] Determine the second sampling number corresponding to each sub - period of the sampling period according to the first sampling number.

[0043] In this embodiment, the appropriate first sampling number for each sampling period can be determined according to the total number of samples in the sample training set, and the appropriate second sampling number for each sub - period can be determined according to the first sampling number, thereby improving the balance of the sampling numbers of each sampling period and sub - period.

[0044] In a second aspect, the present application provides a vehicle image processing device, including:

[0045] A transceiver module, configured to obtain a sample training set and generate sampling pools of the sample training set according to the sample types of the image samples in the sample training set;

[0046] A processing module, configured to determine a sampling ratio corresponding to each sampling pool according to the ratio of the number of image samples in each sampling pool to the total number of samples in the sample training set; determine a first sampling number corresponding to each sampling period and a second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number; determine a second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; for each sampling pool, periodically sample the image samples in the sampling pool according to the second sub-sampling number corresponding to the sub-period; generate a training subset according to the image samples collected from each sampling pool in each sub-period, and train an image recognition model to be trained according to the training subset, where the image recognition model is used to recognize the image features corresponding to the sample type in the image.

[0047] In a third aspect, the present application provides a vehicle image processing device, including: a processor, and a memory communicatively connected to the processor;

[0048] The memory stores computer-executable instructions;

[0049] The processor executes the computer-executable instructions stored in the memory to implement the above method.

[0050] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the above method.

[0051] In a fifth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the above method.

[0052] The vehicle image processing method, device, equipment and medium provided by the present application can first generate sampling pools of the sample training set according to the sample types of the image samples in the sample training set, that is, the image samples are placed by type; then determine the sampling ratio corresponding to each sampling pool according to the ratio of the number of image samples in each sampling pool to the total number of samples in the sample training set. By sampling according to the sampling ratio, image samples of each type can be collected within a sampling period, thereby avoiding the problem of unbalanced sampling caused by random sampling and improving the learning effect of the image recognition model on the image features corresponding to each sample type.

[0053] Furthermore, since the sampling ratio usually cannot be divided evenly, a certain sampling error will occur in each sampling period. When the number of samples is very large, if sampling is directly performed on a relatively small order of magnitude, the sampling error will accumulate significantly, resulting in the remaining image samples in the final stage of sampling all being of the same sample type. Therefore, after determining the sampling ratio corresponding to each sampling pool, the first sampling number with a relatively large order of magnitude can be used as the sampling number for each sampling period to avoid having all the remaining image samples in the final stage of sampling being of the same sample type, further avoiding the problem of uneven sampling, and thus improving the performance of the image recognition model.

[0054] Furthermore, when sampling each sampling period using the first sampling number with a relatively large order of magnitude, due to the large number of samples, it may cause the image samples of the sample type with the largest number to appear concentratedly in each sampling period, thereby affecting the learning effect of the image recognition model. Therefore, for each sampling period, multiple sub-periods are also divided, and the second sampling number with a relatively small order of magnitude is used as the sampling number for each sub-period to avoid the concentrated appearance of image samples of the same sample type in each sampling period, further avoiding the problem of uneven sampling, and thus improving the performance of the image recognition model. After dividing the sub-periods for each sampling period, the second sub-sampling number of each sampling pool in each sub-period can be determined according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; for each sampling pool, the image samples in the sampling pool are sampled periodically according to the second sub-sampling number corresponding to the sub-period. With such a setting, the training subset generated from the image samples collected from each sampling pool according to each sub-period not only conforms to the sampling ratio but also ensures balanced sampling, enabling the image recognition model trained according to this training subset to well possess the performance of recognizing the image features corresponding to the above sample types in the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 is a flowchart of a vehicle image processing method according to an embodiment of the present application;

[0056] Figure 2 is a flowchart of a vehicle image processing method according to another embodiment of the present application;

[0057] Figure 3 is a schematic structural diagram of a vehicle image processing device according to an embodiment of the present application;

[0058] Figure 4 is a schematic structural diagram of a vehicle image processing device according to an embodiment of the present application.

[0059] Reference numerals: 31, transceiver module; 32, processing module. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0060] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0061] The vehicle image processing method of the present application can be applied to scenarios such as ports, highways, logistics, mines, closed parks, or urban traffic, or scenarios related to image processing in machine learning. The vehicle image processing method of the present application can be applied to all of these scenarios.

[0062] Currently, the mainstream deep learning technology is supervised learning. That is, first, a set of training samples with labels is used to train a model so that the model learns certain performance, and then this model is used to predict new samples. Due to the requirements of actual business, the model obtained based on supervised learning may need to have the performance of classifying or recognizing multiple image features. Therefore, when training the model, multiple image samples with different labels, that is, mixed samples, are required. The number of samples of different label types may not be consistent, and there may even be a large gap.

[0063] For the above-mentioned mixed samples, the data sampling process in the prior art is usually random sampling. For example, a user wants to obtain an image recognition model that can recognize image features of two types, A and B. The user provides image samples of two types, A and B, with different numbers as a training sample set and inputs them into a terminal device. After the terminal device obtains the training sample set, it will establish a sampling pool based on the training sample set and put all the image samples in the training sample set into the sampling pool. The sampling pool includes image samples of two types, A and B, and the number of image samples of type A is much larger than the number of image samples of type B. When sampling, the terminal device will randomly grab a certain number of image samples from the sampling pool and input the grabbed image samples into the image model to be trained for model training. Through periodic random sampling, all the image samples in the sampling pool will be input into the image model to be trained so that the image model can learn the performance of recognizing the image features corresponding to the two types, A and B.

[0064] However, when the training samples are mixed samples and the number gap between different types of training samples is large, that is, the quantity is unbalanced, random sampling will cause the problem of unbalanced sampling. Unbalanced sampling may lead to the situation that the trained image model has good learning effect only on the image features with a large number of samples, while has very poor learning effect on other image features, thus affecting the model performance. For example, in the above sampling pool, since the number of image samples of type A is much larger than that of type B, sampling may result in only collecting image samples of type A in the early stage of sampling, and not collecting image samples of type B until the late stage of sampling, making the trained image model have good recognition effect on the image features of type A, while very poor recognition effect on the image features of type B.

[0065] The vehicle image processing method provided by this application aims to solve the above technical problems in the prior art. This method can first generate a sampling pool for the sample training set according to the sample types of each image sample in the sample training set, that is, each image sample is placed by type; then, according to the proportion of the number of image samples in each sampling pool to the total number of samples in the sample training set, determine the sampling ratio corresponding to each sampling pool. By sampling according to the sampling ratio, image samples of each type can be collected within one sampling period, thus avoiding the problem of uneven sampling caused by random sampling and improving the learning effect of the image recognition model on the image features corresponding to each sample type. Further, since the sampling ratio usually cannot be evenly divided, a certain sampling error will be generated in each sampling period. When the number of samples is very large, if sampling is directly performed with a relatively small number magnitude, the sampling error will accumulate significantly, resulting in the remaining image samples in the late stage of sampling being of the same sample type. Therefore, after determining the sampling ratio corresponding to each sampling pool, the first sampling number with a relatively large number magnitude can be first used as the sampling number for each sampling period to avoid the remaining image samples in the late stage of sampling being of the same sample type, further avoiding the problem of uneven sampling, and thus improving the performance of the image recognition model. Further, when sampling each sampling period with the first sampling number with a relatively large number magnitude, due to the large number of samples, it may cause the image samples of the sample type with the largest number to appear concentratedly in each sampling period, thus affecting the learning effect of the image recognition model. Therefore, for each sampling period, multiple sub-periods are also divided, and the second sampling number with a relatively small number magnitude is used as the sampling number for each sub-period to avoid the concentrated appearance of image samples of the same sample type in each sampling period, further avoiding the problem of uneven sampling, and thus improving the performance of the image recognition model. After dividing the sub-periods for each sampling period, the second sub-sampling number of each sampling pool in each sub-period can be determined according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; for each sampling pool, sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period. Through such a setting, the training subset generated from the image samples collected from each sampling pool according to each sub-period not only conforms to the sampling ratio but also ensures sampling balance, enabling the image recognition model trained according to this training subset to well possess the performance of recognizing the image features corresponding to the above sample types in the image.

[0066] The following uses specific embodiments to elaborate in detail on the technical solution of this application and how the technical solution of this application solves the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of this application in conjunction with the accompanying drawings.

[0067] Embodiment 1

[0068] Figure 1 FIG. is a flowchart of a vehicle image processing method provided by an embodiment of the present application. The execution subject of the vehicle image processing method provided by the embodiment of the present application may be a vehicle image processing device or a terminal device integrated with a vehicle image processing device. In this embodiment, the execution subject is a terminal device (abbreviation: terminal device) integrated with a vehicle image processing device to illustrate the vehicle image processing method.

[0069] As Figure 1 shown, the vehicle image processing method may include the following steps:

[0070] S101: Obtain a sample training set and generate a sampling pool of the sample training set according to the sample types of the image samples in the sample training set.

[0071] In this embodiment, the sample training set may include multiple image samples, and each image sample is provided with a type label. An image sample may carry one or more type labels, that is, an image sample may include one or more image features to be recognized.

[0072] Exemplarily, a certain sample training set includes image samples of two types: lane lines and obstacles. An image sample may only have an image of a lane line, that is, the type label is lane line, or only have an image of an obstacle, that is, the type label is obstacle, or may have both an image of a lane line and an obstacle, that is, there are two type labels of lane line and obstacle.

[0073] In a possible implementation manner, generating a sampling pool of the sample training set according to the sample types of the image samples in the sample training set in step S101 above may include: determining the sample types corresponding to the sample training set according to the type labels of the image samples in the sample training set; establishing a sampling pool corresponding to each sample type, and respectively placing the image samples in the sample training set into the corresponding sampling pools according to the type labels.

[0074] In this implementation manner, image samples of the same sample type are all placed in one sampling pool, and different sampling pools have different sample types. When establishing a sampling pool corresponding to each sample type, all image samples may be traversed first to determine the sample types, and then it is judged whether there is a corresponding sampling pool for each sample type. If there is no corresponding sampling pool for a certain sample type, a new sampling pool is created and the newly created sampling pool is associated with the sample type.

[0075] In this embodiment, since the image samples all carry type labels, the sample type corresponding to the sample training set can be simply and accurately determined according to the type labels of the image samples in the sample training set. Since the sample type corresponds to the sampling pool one by one, and the type label corresponds to the sample type one by one, after establishing the sampling pool corresponding to each sample type, each image sample can be simply and accurately placed into the corresponding sampling pool according to the type label.

[0076] S102: Determine the sampling ratio corresponding to each sampling pool according to the ratio of the number of image samples in each sampling pool to the total number of samples in the sample training set.

[0077] In this embodiment, after determining the sampling ratio corresponding to each sampling pool, each sampling pool can be sampled according to the corresponding sampling ratio, avoiding the problem of unbalanced sampling caused by random sampling.

[0078] S103: Determine the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number.

[0079] In this embodiment, during sampling, multiple sampling periods can be first divided according to the larger sampling number, and then each sampling period can be further divided into multiple sub-periods according to the smaller sampling number.

[0080] In a possible implementation manner, determining the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub-period of the sampling period in the above step S103 may include: determining the first sampling number corresponding to each sampling period according to the total number of samples in the sample training set; determining the second sampling number corresponding to each sub-period of the sampling period according to the first sampling number.

[0081] In this embodiment, those skilled in the art can flexibly set the corresponding relationship between the total number of samples and the first sampling number. For example, when the total number of samples is 200,000, the first sampling number can be 1,000 or 2,000, and no restrictions are imposed here. Similarly, those skilled in the art can also flexibly set the corresponding relationship between the first sampling number and the second sampling number. For example, when the first sampling number is 2,000, the second sampling number can be 100 or 200, and no restrictions are imposed here. The first sampling number can be an integer multiple of the second sampling number or not, as long as the first sampling number is greater than the second sampling number and one first sampling number can include multiple second sampling numbers.

[0082] In this embodiment, the first sampling number may also be adjusted according to the number of image samples that the image recognition model can accommodate at one time, that is, the upper limit of the first sampling number is the number of image samples that the image recognition model can accommodate at one time.

[0083] In this embodiment, the appropriate first sampling number for each sampling period may be determined according to the total number of samples in the sample training set, and the appropriate second sampling number for each sub-period may be determined according to the first sampling number, so as to improve the balance of the sampling numbers in each sampling period and sub-period.

[0084] S104: Determine the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool.

[0085] In this embodiment, for the specific implementation of step S104 to determine the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool, please refer to Embodiment 2 for details.

[0086] S105: For each sampling pool, sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period.

[0087] In a possible implementation, step S105 for each sampling pool to sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period may include:

[0088] S1051: For each sampling pool, sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period until the sampling of the current sampling period where the sub-period is located is completed.

[0089] S1052: According to the second sub-sampling numbers corresponding to the sub-periods in the next sampling period of the current sampling period, sample the image samples in the sampling pool periodically until all sampling periods are completed, so that all the image samples in the sampling pool are collected.

[0090] Exemplarily, for sampling pool a, there are 8200 image samples in it. The sampling process is divided into 10 sampling periods in total, and the sampling number for each sampling period is 820; for each sampling period, it is divided into 9 sub-periods, the sampling number for the first 8 sub-periods is 80, and the sampling number for the 9th sub-period is 20. Then for sampling pool a, first collect according to 80 for 8 sub-periods; then collect according to 20 for 1 sub-period, so as to complete the collection of 820 in the first sampling period. Then cycle according to the above collection method until all sampling periods are completed, and a total of 8200 image samples are collected.

[0091] In this embodiment, the sampling of a sampling period can be completed by continuously cycling through sub-periods, and then the sampling of all image samples can be completed by continuously cycling through the sampling periods. Through such a setting, the sampling of all image samples in each sampling pool can be completed simply and orderly, further improving the balance of sampling.

[0092] S106: Generate a training subset based on the image samples collected from each sampling pool in each sub-period, and train the image recognition model to be trained according to the training subset. The image recognition model is used to recognize the image features corresponding to the above sample types in the image.

[0093] In this embodiment, after the image samples are collected from each sampling pool in each sub-period, the collected image samples can be combined to generate a training subset, and then the training subset can be input into the image recognition model to be trained for training. The multiple training subsets generated by multiple sub-periods can be continuously input into the image recognition model to be trained iteratively, so that the finally trained image recognition model has the performance of recognizing the image features corresponding to the above sample types.

[0094] In this embodiment, the sampling pools of the sample training set can be generated first according to the sample types of the image samples in the sample training set, that is, the image samples are placed by category; then, according to the proportion of the number of image samples in each sampling pool to the total number of samples in the sample training set, the sampling ratio corresponding to each sampling pool is determined. By sampling according to the sampling ratio, image samples of each type can be collected within one sampling period, thus avoiding the problem of uneven sampling caused by random sampling and improving the learning effect of the image recognition model on the image features corresponding to each sample type.

[0095] Furthermore, since the sampling ratio usually cannot be divided evenly, a certain sampling error will be generated in each sampling period. When the number of samples is very large, if sampling is directly performed in a relatively small number magnitude, the sampling error will accumulate significantly, resulting in the remaining image samples in the late stage of sampling being of the same sample type. Therefore, after determining the sampling ratio corresponding to each sampling pool, the first sampling number with a relatively large number magnitude can be used as the sampling number for each sampling period to avoid the remaining image samples in the late stage of sampling being of the same sample type, further avoiding the problem of uneven sampling, and thus improving the performance of the image recognition model.

[0096] Furthermore, when sampling each sampling period with a relatively large first sampling number, due to the large sampling number, it may cause the image samples of the sample type with the largest number to appear concentrated in each sampling period, thus affecting the learning effect of the image recognition model. Therefore, for each sampling period, multiple sub-periods are also divided, and a relatively small second sampling number is used as the sampling number for each sub-period to avoid the concentrated appearance of image samples of the same sample type in each sampling period, further avoiding the problem of uneven sampling, thereby improving the performance of the image recognition model. After dividing the sub-periods for each sampling period, the second sub-sampling number of each sampling pool in each sub-period can be determined according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; for each sampling pool, the image samples in the sampling pool are sampled periodically according to the second sub-sampling number corresponding to the sub-period. Through such a setting, the training subset generated from the image samples collected from each sampling pool in each sub-period not only conforms to the sampling ratio but also ensures balanced sampling, enabling the image recognition model trained according to this training subset to well possess the performance of recognizing the image features corresponding to the above sample types in the image.

[0097] The following takes Embodiment 2 to elaborate in detail on the specific implementation manner of determining the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool in step S104 of the above Embodiment 1.

[0098] Embodiment 2

[0099] Figure 2 is a flowchart of a vehicle image processing method provided by another embodiment of the present application. The execution subject of the vehicle image processing method provided by the embodiment of the present application can be a vehicle image processing device or a terminal device integrated with a vehicle image processing device. In this embodiment, the execution subject is a terminal device (abbreviation: terminal device) integrated with a vehicle image processing device to illustrate this vehicle image processing method. As Figure 2 shown, the vehicle image processing method may include the following steps:

[0100] S201: Determine the first sub-sampling number of each sampling pool in each sampling period according to the first sampling number and the sampling ratio corresponding to each sampling pool.

[0101] In this embodiment, since the sampling ratio may not be divisible exactly, the first sub-sampling numbers in each sampling period may be the same or different.

[0102] In a possible implementation manner, the above step S201 may determine the first sub-sampling number of each sampling pool in each sampling period according to the first sampling number and the sampling ratio corresponding to each sampling pool, and may include:

[0103] S2011: Simplify the sampling ratio corresponding to each sampling pool according to the first sampling number to obtain the first sampling ratio corresponding to each sampling pool.

[0104] S2012: Determine the first standard sub-sampling number of each sampling pool in the sampling period according to the first sampling number and the first sampling ratio corresponding to each sampling pool.

[0105] S2013: For each sampling pool, determine whether there is an end sampling period in the sampling period where the remaining sample number is less than the first standard sub-sampling number according to the number of all image samples in the sampling pool.

[0106] S2014: If so, determine the first actual sub-sampling number of each sampling pool in the end sampling period according to the remaining sample number in the end sampling period; determine the first sub-sampling number of each sampling pool in each sampling period according to the first actual sub-sampling number of each sampling pool in the end sampling period and the first standard sub-sampling number of each sampling pool in other sampling periods except the end sampling period.

[0107] S2015: If not, determine the first sub-sampling number of each sampling pool in each sampling period according to the first standard sub-sampling number of each sampling pool in the sampling period.

[0108] In this implementation manner, simplifying the sampling ratio corresponding to each sampling pool according to the first sampling number to obtain the first sampling ratio corresponding to each sampling pool means simplifying the first sampling ratio to a certain number of digits so that the product of the first sampling ratio and the first sampling number is an integer. Exemplarily, if the first sampling number is 1000 and the sampling ratio corresponding to a certain sampling pool is 0.87543, then this sampling ratio can be simplified to 0.875. Then the product of the first sampling number and the first sampling ratio, 1000×0.875 = 875, is the first standard sub-sampling number of this sampling pool in the sampling period.

[0109] In this embodiment, the sampling ratio corresponding to each sampling pool is simplified. Specifically, those skilled in the art can flexibly select the number of digits for simplification according to the first sampling number, and no limitation is imposed here. For example, when the first sampling number is 1000 and the sampling ratio corresponding to a certain sampling pool is 0.87543, the number of digits for simplification can be three digits after the decimal point (0.875), or two digits after the decimal point (0.88). Simplifying the sampling ratio corresponding to each sampling pool can conform to the rounding simplification principle.

[0110] In this embodiment, since the sampling ratio may not be divisible exactly, therefore, first, the sampling ratio corresponding to each sampling pool needs to be simplified according to the first sampling number to obtain the first sampling ratio corresponding to each sampling pool, so that the first sub-sampling numbers obtained according to the first sampling ratio are more balanced, avoiding the situation that the remaining image samples at the end of sampling are all of the same sample type, and further avoiding the problem of unbalanced sampling. Further, for each sampling pool, when the number of all image samples in the sampling pool is not an integer multiple of the first standard sub-sampling number, there will be an end sampling period with the remaining sample number less than the first standard sub-sampling number. At this time, the first actual sub-sampling number of each sampling pool in the end sampling period can be determined according to the remaining sample number in the end sampling period. When there is an end sampling period, the first sub-sampling number of each sampling pool in each sampling period can be determined according to the first actual sub-sampling number and the first standard sub-sampling number. Through such a setting, the first sub-sampling number of each sampling pool in each sampling period can be determined more accurately, improving the accuracy of the first sub-sampling number and also improving the accuracy of determining the second sub-sampling number using the first sub-sampling number.

[0111] S202: Determine the second sub-sampling number of each sampling pool in each sub-period according to the first sub-sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool.

[0112] In this embodiment, since the sampling ratio may not be divisible exactly, therefore, the second sub-sampling numbers in each sub-period can be the same or different.

[0113] In a possible implementation manner, the above step S202 of determining the second sub-sampling number of each sampling pool in each sub-period according to the first sub-sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool may include:

[0114] S2021: Simplify the sampling ratio corresponding to each sampling pool according to the second sampling number to obtain the second sampling ratio corresponding to each sampling pool.

[0115] S2022: Determine the second standard sub-sampling number of each sampling pool in each sub-cycle according to the second sampling number and the second sampling ratio corresponding to each sampling pool.

[0116] S2023: For each sampling pool, determine whether there is an end sub-cycle in the sampling cycle where the sub-cycle is located, in which the remaining sample number is less than the second standard sub-sampling number, according to the first sub-sampling number.

[0117] S2024: If so, determine the second actual sub-sampling number of each sampling pool in the end sub-cycle according to the remaining sample number in the end sub-cycle; determine the second sub-sampling number of each sampling pool in each sub-cycle according to the second actual sub-sampling number of each sampling pool in the end sub-cycle and the second standard sub-sampling number of each sampling pool in other sub-cycles except the end sub-cycle.

[0118] S2025: If not, determine the second sub-sampling number of each sampling pool in each sub-cycle according to the second standard sub-sampling number of each sampling pool in the sub-cycle.

[0119] In this embodiment, simplifying the sampling ratio corresponding to each sampling pool according to the second sampling number to obtain the second sampling ratio corresponding to each sampling pool means simplifying the second sampling ratio to a certain number of digits so that the product of the second sampling ratio and the second sampling number is an integer. Exemplarily, if the second sampling number is 100 and the sampling ratio corresponding to a certain sampling pool is 0.87543, then this sampling ratio can be simplified to 0.88. Then the product of the second sampling number and the second sampling ratio, 100×0.88 = 88, is the second standard sub-sampling number of this sampling pool in the sub-cycle.

[0120] In this embodiment, for the simplification process of the sampling ratio corresponding to each sampling pool, the specific number of digits for simplification can be flexibly selected by those skilled in the art according to the second sampling number, and no limitation is made here. For example, when the second sampling number is 100 and the sampling ratio corresponding to a certain sampling pool is 0.87543, the number of digits for simplification can be two digits after the decimal point (0.88), or one digit after the decimal point (0.89). Simplifying the sampling ratio corresponding to each sampling pool can conform to the rounding simplification principle.

[0121] In this embodiment, the number of digits for simplification of the first sampling ratio and the second sampling ratio are generally different, so that the sampling number of the sampling cycle takes more consideration of the balance at the sampling end, while the sampling number of the sub-cycle takes more consideration of the balance of the sampling cycle.

[0122] In this embodiment, since the sampling ratio may not be divisible exactly, first, it is necessary to simplify the sampling ratio corresponding to each sampling pool according to the second sampling number to obtain the second sampling ratio corresponding to each sampling pool, so that the second subsampling number obtained according to the second sampling ratio is more balanced, avoiding the concentration of image samples of the same sample type in each sampling period, and further avoiding the problem of unbalanced sampling. Further, for each sampling pool, when the first subsampling number in the sampling period is not an integer multiple of the second standard subsampling number, there will be an end sub-period with the remaining sample number less than the second standard subsampling number. At this time, the second actual subsampling number of each sampling pool in the end sub-period can be determined according to the remaining sample number in the end sub-period. When there is an end sub-period, the second subsampling number of each sampling pool in each sub-period can be determined according to the second actual subsampling number and the second standard subsampling number. Through such a setting, the second subsampling number of each sampling pool in each sub-period can be determined more accurately, improving the accuracy of the second subsampling number and also improving the balance and accuracy of periodic sampling using the second subsampling number.

[0123] In this embodiment, after determining the first sampling number corresponding to each sampling period and the sampling ratio corresponding to each sampling pool, the first subsampling number of each sampling pool in each sampling period can be simply and accurately determined accordingly, thereby improving the balance of the sampling number in each sampling period. After determining the second sampling number corresponding to each sub-period and the sampling ratio corresponding to each sampling pool, the standard subsampling number of each sampling pool in each sub-period can be simply and conveniently determined accordingly. Since the sampling ratio usually cannot be divisible exactly, the first subsampling number may not be an integer multiple of the standard subsampling number. Therefore, it is necessary to adjust the standard subsampling number using the first subsampling number to obtain the second subsampling number of each sampling pool in each sub-period. Through such a setting, the second subsampling number of each sampling pool in each sub-period finally obtained can be more balanced, further improving the balance of sampling, and thus improving the performance of the image recognition model.

[0124] The vehicle image processing method of the present application will be described below with a specific embodiment.

[0125] Embodiment III

[0126] In a specific embodiment, a user wants to train an image recognition model capable of recognizing lane lines and obstacles. The user collects a certain number of lane line images and a certain number of obstacle images as image samples, and labels the type of each image sample. The user inputs these image samples and type labels as a training sample set into a terminal device loaded with an image recognition model. The specific image processing process is as follows:

[0127] First, the terminal device obtains a sample training set, determines the sample type corresponding to the sample training set according to the type labels of the image samples in the sample training set, establishes a sampling pool corresponding to each sample type, and respectively puts the image samples in the sample training set into the corresponding sampling pools according to the type labels.

[0128] Second, the terminal device determines the sampling ratio corresponding to each sampling pool according to the ratio of the number of image samples in each sampling pool to the total number of samples in the sample training set.

[0129] Third, the terminal device determines the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number.

[0130] Fourth, the terminal device determines the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool.

[0131] Fifth, for each sampling pool, the terminal device periodically samples the image samples in the sampling pool according to the second sub-sampling number corresponding to the sub-period until the sampling of the current sampling period where the sub-period is located is completed. According to the second sub-sampling numbers corresponding to the sub-periods in the next sampling period of the current sampling period, the image samples in the sampling pool are periodically sampled until all sampling periods are completed, so that all the image samples in the sampling pool are collected.

[0132] Sixth, the terminal device generates a training subset according to the image samples collected from each sampling pool in each sub-period, and trains the image recognition model to be trained according to the training subset. The image recognition model is used to recognize the image features corresponding to the lane lines and obstacles.

[0133] Figure 3 It is a schematic structural diagram of a vehicle image processing device according to an embodiment of the present application, as Figure 3As shown in the figure, the vehicle image processing device includes: a transceiver module 31 and a processing module 32. The transceiver module 31 is configured to obtain a sample training set and generate a sampling pool of the sample training set according to the sample types of the image samples in the sample training set. The processing module 32 is configured to determine the sampling ratio corresponding to each sampling pool according to the ratio of the number of image samples in each sampling pool to the total number of samples in the sample training set; determine the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number; determine the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; for each sampling pool, sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period; generate a training subset according to the image samples collected from each sampling pool in each sub-period, and train the image recognition model to be trained according to the training subset. The image recognition model is used to recognize the image features corresponding to the sample type in the image. In one embodiment, the description of the specific implementation functions of the vehicle image processing device can refer to steps S101 - S106 in Embodiment 1 and steps S201 - S202 in Embodiment 2, which will not be elaborated here.

[0134] Figure 4 FIG. is a schematic structural diagram of a vehicle image processing device according to an embodiment of the present application. As Figure 4 shown, the vehicle image processing device includes: a processor 101 and a memory 102 communicatively connected to the processor 101; the memory 102 stores computer-executable instructions; the processor 101 executes the computer-executable instructions stored in the memory 102 to implement the steps of the vehicle image processing method in the above method embodiments.

[0135] The vehicle image processing device can be independent or a part of a terminal device. The processor 101 and the memory 102 can adopt the existing hardware of the terminal device.

[0136] In the above vehicle image processing device, the memory 102 and the processor 101 are directly or indirectly electrically connected to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines, such as through a bus connection. The memory 102 stores computer-executable instructions for implementing the data access control method, including at least one software function module stored in the memory 102 in the form of software or firmware. The processor 101 executes the software programs and modules stored in the memory 102 to perform various functional applications and data processing.

[0137] The memory 102 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. Among them, the memory 102 is used to store programs, and after receiving an execution instruction, the processor 101 executes the programs. Further, the software programs and modules in the memory 102 may further include an operating system, which may include various software components and / or drivers for managing system tasks (such as memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide a running environment for other software components.

[0138] The processor 101 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0139] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the steps of the method embodiments of the present application.

[0140] An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the method embodiments of the present application.

[0141] Those skilled in the art will readily think of other implementations of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include the common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the appended claims.

[0142] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A vehicle image processing method, characterized in that, it includes: Obtain a sample training set, and generate a sampling pool of the sample training set according to the sample types of each image sample in the sample training set; Determine the sampling ratio corresponding to each sampling pool according to the proportion of the number of image samples in each sampling pool to the total number of samples in the sample training set; Determine the first sampling number corresponding to each sampling period, and the second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number; Simplify the sampling ratio corresponding to each sampling pool according to the first sampling number to obtain the first sampling ratio corresponding to each sampling pool; the simplification process refers to simplifying the first sampling ratio to a certain number of digits so that the product of the first sampling ratio and the first sampling number is an integer; Determine the first standard sub-sampling number of each sampling pool in the sampling period according to the first sampling number and the first sampling ratio corresponding to each sampling pool; For each sampling pool, judge whether there is an end sampling period in the sampling period where the remaining sample number is less than the first standard sub-sampling number according to the number of all image samples in the sampling pool; If so, determine the first actual sub-sampling number of each sampling pool in the end sampling period according to the remaining sample number in the end sampling period; determine the first sub-sampling number of each sampling pool in each sampling period according to the first actual sub-sampling number of each sampling pool in the end sampling period and the first standard sub-sampling number of each sampling pool in other sampling periods except the end sampling period; If not, determine the first sub-sampling number of each sampling pool in each sampling period according to the first standard sub-sampling number of each sampling pool in the sampling period; Determine the second sub-sampling number of each sampling pool in each sub-period according to the first sub-sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; For each sampling pool, sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period; Generate a training subset according to the image samples collected from each sampling pool in each sub-period, and train the image recognition model to be trained according to the training subset, where the image recognition model is used to recognize the image features corresponding to the sample type in the image.

2. The method according to claim 1, characterized in that, The step of determining the second sub-sampling number of each sampling pool in each sub-period according to the first sub-sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool specifically includes: Simplify the sampling ratio corresponding to each sampling pool according to the second sampling number to obtain the second sampling ratio corresponding to each sampling pool; the simplification process refers to simplifying the second sampling ratio to a certain number of digits so that the product of the second sampling ratio and the second sampling number is an integer; Determine the second standard sub-sampling number of each sampling pool in each sub-period according to the second sampling number and the second sampling ratio corresponding to each sampling pool; For each sampling pool, according to the first sub-sampling number, determine whether there is an end sub-period in the sampling period where the sub-period is located and the remaining sample number is less than the second standard sub-sampling number; If so, determine the second actual sub-sampling number of each sampling pool in the end sub-period according to the remaining sample number in the end sub-period; according to the second actual sub-sampling number of each sampling pool in the end sub-period and the second standard sub-sampling number of each sampling pool in other sub-periods except the end sub-period, determine the second sub-sampling number of each sampling pool in each sub-period; If not, determine the second sub-sampling number of each sampling pool in each sub-period according to the second standard sub-sampling number of each sampling pool in the sub-period.

3. The method according to claim 1 or 2, characterized in that, For each sampling pool, periodically sampling the image samples in the sampling pool according to the second sub-sampling number corresponding to the sub-period specifically includes: For each sampling pool, periodically sample the image samples in the sampling pool according to the second sub-sampling number corresponding to the sub-period until the sampling of the current sampling period where the sub-period is located is completed; According to the second sub-sampling numbers corresponding to the sub-periods in the next sampling period of the current sampling period, periodically sample the image samples in the sampling pool until all sampling periods are completed, so that all the image samples in the sampling pool are collected.

4. The method according to claim 1 or 2, characterized in that, Generating the sampling pool of the sample training set according to the sample types of the image samples in the sample training set specifically includes: Determine the sample types corresponding to the sample training set according to the type labels of the image samples in the sample training set; Establish sampling pools corresponding to each sample type, and respectively put the image samples in the sample training set into the corresponding sampling pools according to the type labels.

5. The method according to claim 1 or 2, characterized in that, Determining the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub-period of the sampling period specifically includes: Determine the first sampling number corresponding to each sampling period according to the total number of samples in the sample training set; According to the first sampling number, determine the second sampling number corresponding to each sub-period of the sampling period.

6. A vehicle image processing device, comprising: A transceiver module, configured to obtain a sample training set and generate a sampling pool of the sample training set according to the sample types of the image samples in the sample training set; A processing module, configured to determine the sampling ratio corresponding to each sampling pool according to the proportion of the number of image samples in each sampling pool to the total number of samples in the sample training set; determine the first sampling number corresponding to each sampling period and the second sampling number corresponding to each sub-period of the sampling period, where the first sampling number is greater than the second sampling number; determine the second sub-sampling number of each sampling pool in each sub-period according to the first sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool; for each sampling pool, sample the image samples in the sampling pool periodically according to the second sub-sampling number corresponding to the sub-period; Generate a training subset according to the image samples collected from each sampling pool in each sub-period, and train the image recognition model to be trained according to the training subset, where the image recognition model is configured to recognize the image features corresponding to the sample type in the image; The processing module is specifically configured to simplify the sampling ratio corresponding to each sampling pool according to the first sampling number to obtain the first sampling ratio corresponding to each sampling pool; the simplification process refers to simplifying the first sampling ratio to a certain number of digits so that the product of the first sampling ratio and the first sampling number is an integer; Determine the first standard sub-sampling number of each sampling pool in the sampling period according to the first sampling number and the first sampling ratio corresponding to each sampling pool; For each sampling pool, determine whether there is an end sampling period in the sampling period where the remaining sample number is less than the first standard sub-sampling number according to the number of all image samples in the sampling pool; If so, determine the first actual sub-sampling number of each sampling pool in the end sampling period according to the remaining sample number in the end sampling period; determine the first sub-sampling number of each sampling pool in each sampling period according to the first actual sub-sampling number of each sampling pool in the end sampling period and the first standard sub-sampling number of each sampling pool in other sampling periods except the end sampling period; If not, determine the first sub-sampling number of each sampling pool in each sampling period according to the first standard sub-sampling number of each sampling pool in the sampling period; Determine the second sub-sampling number of each sampling pool in each sub-period according to the first sub-sampling number, the second sampling number, and the sampling ratio corresponding to each sampling pool.

7. A vehicle image processing device, including a processor and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image model training method, electronic equipment, roadside equipment and cloud control platform

    CN113420792A

  • Neural network training and image processing method and device, equipment and storage medium

    CN113792734A