Train a regression model to map the classification of any smoke picture to the corresponding volume of traffic.
The steps are as follows:
1. Data preprocessing: The existing data set of smoke picture classification and traffic volume is divided into a training set and a test set. For each sample in the training set, its smoke classification label(1~5) is converted into the corresponding flow size(which can be defined by itself), which is used as the target value of the training data. For each sample in the test set, its smoke classification label also needs to be converted to the target value.
2. Feature extraction: VGG16 model is used to extract features from all smoke pictures in the training set and test set, and transform them into a feature vector. The output of some layers in the VGG16 model can be used as feature vectors, or the output of these layers can be spliced together to obtain higher-dimensional feature vectors.
3. Model training: A regression model is trained by using feature vectors and target values in the training set. You can choose linear regression, SVR, random forest regression and other models, or you can use neural network models.
4. Test and evaluation: The feature vectors and target values of the test set are used to test and evaluate the trained regression model. Mean square error(MSE), mean absolute error(MAE) and other indexes can be used to evaluate the performance of the model.
5. Prediction: For a new smoke picture, the VGG16 model is used to extract its feature vector and input it into the trained regression model to get the predicted flow size.