Development and construction of dense crowd density estimation and analysis system based on convolutional neural network CNN model

In many real-life scenarios, such as: stations, subways, supermarkets and other crowded places are prone to dangerous events such as stampedes. For the management level, timely analysis and calculation of crowd density and timely warning of potential dangers can prevent disasters to the greatest extent. Yu Weiran, here is mainly based on this idea to develop and build a dense crowd estimation and analysis system based on the convolutional neural network model. First, look at the renderings:

 Just look at the dataset:

 The annotation file is as follows:

 The tag parsing build is implemented as follows:

def parseLabel(labelData="train_label.csv", save_path="labelMap.json"):
    """
    解析构建标签数据
    """
    df = pd.read_csv(labelData)
    data = df.values.tolist()
    data_dict = {}
    for one_list in data:
        one_path, one_label = one_list
        data_dict[one_path] = one_label
    with open(save_path, "w") as f:
        f.write(json.dumps(data_dict))

A screenshot of the model parameters is as follows:

 At the beginning, I trained 500 iterations, and the loss changes as follows:

 The overall situation has stabilized, but the final loss value is still relatively large, just like increasing the training cycle. Here, 3000 rounds of iterative calculations are constructed, as follows:

At this time, you can see that the effect is already very good. The log is as follows:

 Next, load the trained model and perform test analysis as follows:

 Judging from the evaluation indicators, the effect is still very good.

In order to facilitate the use of the model, a visual interface has been developed here, as follows:

 In order to intuitively analyze the calculation basis of the model, the heat map is calculated based on GradCAM as follows:

Guess you like

Origin blog.csdn.net/Together_CZ/article/details/130078394