Abstract

The rapid development of the tourism industry and the Internet era has led to an increasingly severe problem of travel information overload, and travel recommendation methods are essential to solving the information overload problem. Traditional recommendation algorithms only target common travel scenarios during the daytime, combining the ratings and necessary attributes between users and items to calculate similarity for a recommendation. Still, the research on night travel recommendations is one of the few scenarios that needs to be explored urgently. This paper, based on histogram equalization, achieves better experimental results on image enhancement, combines convolutional neural network technology with night image and text comment feature extraction technology, and evaluates the resulting error with mean absolute error (MAE). This paper presents the first night travel recommendation system. It compares it with the traditional collaborative filtering method, and the model proposed in this paper can effectively reduce the prediction error.

1. Introduction

Online travel has become a daily travel application, primarily bringing convenience for people to travel and tour. However, with the increasing number of travelers and the explosive growth of information on the internet, it is difficult for travel users to quickly find the travel data they need in massive data. The emergence of recommendation systems effectively solved this problem of information overload. A recommendation system [1] refers to a website platform, which digs the explicit and implicit information of users to determine their preferences, and selects the N products that best match them, thus helping them to make efficient choices. In order to further study the recommendation system, people have developed various recommendation algorithms.

However, the research on the travel recommendation systems for night scenes has always been a problematic research field because the biggest difference between night and day is the significant difference in lighting conditions. It is not perfect to use the data of daytime travel directly for a recommendation. Therefore, this paper presents a feasible solution to solve one of the challenges by using intelligent image processing technology. Image enhancement processing usually does not consider the reason of image quality degradation. However, it only uses specific techniques to selectively highlight the interesting features in the image according to the image features and processing purposes and may suppress another part of the information, so as to improve the visual effect of the image or facilitate the analysis and processing of the picture by humans or computers. Its main purpose is to improve the comprehensibility of the image.

Traditional image enhancement methods can be divided into spatial domain and frequency domain methods according to different scopes. The spatial domain method refers to the arithmetic processing of pixel gray values directly in the spatial domain. The commonly used spatial domain methods include grayscale transformation, histogram modification, image space smoothing and sharpening, and pseudo-color processing. The frequency domain method enhances the transform value of the image in a certain transform domain and then obtains the enhanced image through inverse transformation.

Commonly used recommendation algorithms include content-based recommendation algorithm, collaborative filtering recommendation algorithm, CF recommendation algorithm, and mixed recommendation algorithm [2]. Content-based recommendation algorithm analyzes the users’ historical content data, builds an interest model, and recommends similar interesting items to users. However, the biggest problem with this algorithm is that the recommendation domain is narrow. The collaborative filtering algorithm only relies on the historical data of users to obtain a group of users with similar interests and then recommends this group of users’ preference items to the target users [3]. The hybrid recommendation algorithm is the most effective algorithm to solve the shortcomings of various algorithms in theory, but the design of this algorithm is relatively complex.

In recent years, artificial intelligence is in full swing. As an important research direction in artificial intelligence, deep learning has penetrated into various industries. Deep learning can deeply mine data features in image, text, and natural language processing and has made some progress, especially for hidden information which is easy to be ignored. In traditional tourism recommendation models, predictions are only based on the scores between tourists and scenic spots, which lack the information about the characteristics and attributes of tourists and scenic spots and tourists’ evaluation of tourism experience. A multimodal recommendation algorithm based on deep multimodal learning is proposed, which establishes the feature representation between multimodal features in videos and effectively obtains more information. Gao and Xu [4] used the recursive neural network to process the time series data of users and movies, so as to recommend movies more accurately. They used long-term and short-term memory units to accumulate historical states at long distances, which ultimately improve the accuracy of recommendation.

However, most of the current standard recommendation systems are based on textual review features and recommendations made by daytime well-lit tourist attraction picture features. Despite these, travel suggestions under low light conditions at night are still tasted because of low visibility, or travel suggestions during the day are directly adopted. This paper mainly studies the complex problem of night travel recommendations under the general lighting conditions. In this paper, the night travel recommendation model is designed by using a histogram equalization-based night image enhancement algorithm and collaborative filtering combined with the convolutional neural network.

2. Materials and Methods

2.1. Common Methods and Quality Evaluation of Image Enhancement for Night Tourist Attraction

Usually, the acquired images cannot be processed directly by using the computer and must be converted into digital images before processing can be performed. The process of digitization consists of 3 steps: scanning, sampling, and quantization. From the computer’s point of view, a digital image can be seen as an image obtained by sampling and quantizing a two-dimensional function f(x, y), i.e., after discrete processing. Therefore, an image is usually represented by a two-dimensional matrix. When an image is generated from a physical process, its value is usually proportional to the radiated energy of the physical source (e.g., electromagnetic waves). Therefore, f(x, y) must be nonzero and finite.

Digitizing an image will result in a two-dimensional matrix of integers, as in equation (1), which defines a digital image of size MN:where each element of the matrix is called an image unit, image element, or pixel.

2.1.1. Night Image Enhancement Basic Method

Image enhancement techniques usually have two types of methods: spatial domain methods and frequency domain methods. Spatial domain enhancement methods target direct processing of pixel grayscale values. Common ones are grayscale transformations, image smoothing and sharpening in the null domain, histogram correction, pseudo-color processing, etc. Frequency domain enhancement methods are based on the Fourier transform of the image to enhance or suppress the desired spectrum, thus achieving an improvement of the image spectrum.

(1) Grayscale Transformation. Grayscale transformation is one of the simplest and most important means of image enhancement techniques. Grayscale transform extends the image contrast to obtain a clearer image. It corrects the grayscale of the input pixels, and the grayscale transform can be expressed aswhere T denotes the function relationship between the input gray value and the output gray value. According to different application requirements and the nature of the function, the following grayscale transformation methods can be used.

For a given grayscale space, let the grayscale transformation range of the original image f(x, y) be [a, b] and the grayscale extension of the transformed image g(x, y) be [c, d]; then, a proportional linear grayscale change can be used to achieve.

The proportional linear grayscale transform operation is relatively simple, and it can effectively change the image visual effect.

And the segmented linear transform has a better enhancement effect in stretching the gray details of feature objects and suppressing the uninteresting gray levels with the following mathematical expressions:

(2) Histogram Correction. The histogram of an image represents the statistical relationship between each gray level and its frequency. Usually, the horizontal coordinate represents the gray level, and the vertical coordinate represents the frequency. According to the definition of the histogram, it can be expressed aswhere N is the total number of pixels in an image, nk denotes the number of pixels at the kth gray level, rk is the kth gray level, L is the number of gray levels, and p(rk) denotes the relative frequency of the occurrence of that gray level.

Histogram is the main means to reflect the general characteristics of a digital image. It gives information about the grayscale range, the grayscale distribution, the average brightness, and the contrast between light and dark of a digital image, which is an important basis for further processing of digital images.

The histogram equalization method is a common grayscale enhancement algorithm that transforms a known grayscale probability density distribution into a new image with a uniform grayscale probability density distribution to enhance the overall contrast of the image.

Assuming that the number of pixels in an image is n, there are l gray levels, and nk represents the number of pixels with a gray level of gas, the probability of the occurrence of the kth gray level can be expressed aswhere 0 ≤ rk ≤ 1 and. The transformation function T(r) is

From the above calculation process, it can be seen that the statistical value of the histogram of the original input image can calculate the grayscale value of each pixel after equalization. The histogram equalization results in the stretching of the dense grayscale distribution and the compression of the sparse grayscale distribution, thus enhancing the overall contrast of an image.

However, the traditional histogram equalization algorithm is processed for the whole image, so there are some insurmountable defects: (1) the brightness information of the original image is not retained, and the grayscale is approximately uniformly distributed in the processed image, so the average brightness is always around the median of the grayscale range; (2) the phenomenon of parsimony occurs in the process, i.e., some low-frequency grayscale may be combined, and the total grayscale level will be lost, thus causing the loss of image details. For these drawbacks, some improvement methods are listed in the next section of this paper.

2.1.2. Image Quality Evaluation Criteria

Image quality evaluation [5] is one of the basic techniques of image information engineering, and there are two kinds of subjective and objective evaluations. Subjective evaluation is to let observers make quality judgments on test images according to visual effects based on some predefined evaluation scales or their own experiences and give quality scores, and finally, the scores given by all observers are weighted and averaged, and the result is the subjective quality evaluation of the image. The subjective evaluation is determined by some subjective factors such as individual knowledge background, observation purpose, and prevailing environment because different individuals evaluate the same image. The two commonly used subjective evaluation methods are the absolute scale grading method and the relative scale grading method.

(1) Mean Value. The mean value indicates the average value of image grayscale, which reflects the image illumination situation.

(2) Mean Square Error. The mean square error, also called the mean squared error of the image gray value, reflects the dynamic range of the image gray value. Let f(i, j) denote the original image, denote the distorted image of f(i, j), and the mean square error between f(i, j) and for any i and j iswhere M and N denote the height and width of the image, respectively. Obviously, the smaller the MSE value is, the more similar the two images are before and after information hiding.

(3) Information Entropy. For an image with n levels of gray, if the probability of the occurrence of its ith level of gray is pi, then the entropy of that level of gray is

Then, the entropy of the whole image is

(4) Peak Signal-to-Noise Ratio. The peak signal-to-noise ratio is defined as follows:where H and W indicate the height and width of the image, respectively. Usually, a larger PSNR value indicates a better image recovery, but it does not mean that the subjective quality is higher.

2.2. Night Image Improvement Algorithm Based on Histogram Equalization

Histogram equalization is one of the very important algorithms in image enhancement. It uses basic knowledge of probability theory to perform gray point operations for the purpose of histogram transformation [68]. The essence of the image histogram equalization algorithm is to selectively enhance the low-frequency information and suppress the high-frequency information of the image. After histogram equalization of an image, the grayscale that originally possesses fewer pixels is most likely to be merged. In contrast, the boundaries between image regions that normally occupy fewer pixels contain important structural information, which may cause the loss of image details. In addition, various types of image noise are inevitably present in the image, and then the image noise will be amplified accordingly [7, 9]. Therefore, the traditional histogram equalization algorithm has the disadvantages of image detail information loss and noise amplification.

2.2.1. Improved Algorithm 1
(1)For each pixel in the original image, it is recorded into the corresponding pixel number accumulator ri according to its grayscale value.(2)Select the appropriate mapping relationship for the number of pixels. Here, ri= log (ri+1) is used, and ri and are calculated, respectively.

Calculate the converted grayscale value of grayscale i in the original image.

The grayscale conversion method of the above equation can extend the gray space of the original image so that the converted grayscale values are distributed over the entire gray space.

2.2.2. Improved Algorithm 2

For the grayscale fi(x, y), at level i in the original image grayscale histogram, the position of its corrected grayscale is determined based on the ratio of and on its left and right sides using the following equation j:

Collate to obtain

Furthermore, it is reduced to

2.2.3. Improved Algorithm 3

After histogram equalization of the image, the average brightness of the output image usually lies in the middle of the gray level of the image. By using histogram recursive decomposition and segmented equalization, we can achieve multilevel brightness control of the output image, thus avoiding the unnatural enhancement effect caused by too much brightness after enhancement.

The basic idea of histogram recursive decomposition and segmented equalization is to use the average luminance as the closed value, decompose the image recursively according to the specified depth r, so as to obtain 2r subimages of different grayscale ranges, then make histogram equalization for each subimage, and finally merge the equalized subimages to obtain the equalization result of the night image. Obviously, when the recurrence depth r is 0, the input image is not decomposed in any way, i.e., in the conventional way. The case when r is 1 is illustrated below, and so on for other cases.

First, the original image X is divided into two subgraphs X1 and X2, with the grayscale mean value Gm as the threshold, i.e.,

Next, the histograms are counted for each of the two subplots and equalized in the grayscale range on each side of the respective mean.

Then, the processed subgraphs are merged:

Since the segmentation, processing, and merging are performed in grayscale dependence, the spatial location of the enhanced pixels does not change. Similarly, according to the recurrence depth, the image is decomposed into 2r subimages according to the average luminance, then each of them is histogram equalized, and finally, the equalized subimages are merged. Then, the average luminance of the output image is

From the above equation, we can see that the greater the depth of decomposing the image is, the closer the average brightness of the final image obtained will be to the average brightness of the input image. Therefore, we can use different r values to achieve luminance control. The above method can automatically extend the range of image gray levels and, at the same time, can control the average luminance of the output image with better enhancement effect. However, there is still the disadvantage of gray level merging, and the image gray level average value is still offset.

2.3. Night Tour Recommendation Model Design

This paper improves the feature recognition of night attraction images by combining the techniques of night image enhancement in the previous section. Combining convolutional neural networks and collaborative filtering methods, we extract and classify the factor features in night attraction images and visitor text reviews by convolutional neural networks and predict the user item ratings by using collaborative filtering methods. Among them, the convolutional neural network for mining features in reviews can effectively alleviate the data sparsity problem in the collaborative filtering method [10], and the method can retain the advantages of shared experience and personalization in the collaborative filtering method.

2.3.1. Collaborative Filtering Recommendation Algorithm

As the most widely used recommendation algorithm, the core idea of collaborative filtering is to calculate the similarity between users or items to achieve recommendations. User-based collaborative filtering recommendation algorithm calculates the similarity between users, establishes the nearest-neighbor user group, and then recommends the products of interest in the nearest-neighbor group to the target users; item-based collaborative filtering recommendation algorithm calculates the similarity between items; model-based collaborative filtering recommendation algorithm combines some intelligent models to train and test the data in order to obtain the user’s preference information more effectively to achieve recommendations.

In order to find users or items in close proximity, similarity calculation is the key. The most commonly used methods to calculate similarity are Pearson’s method and cosine method [11]. Among them, the Pearson similarity method is more applicable to the calculation of document data and is more comprehensive for different users, which is expressed by the following formula:

Chen et al. [12] used a new dynamic evolutionary clustering algorithm to divide the set of users and items into K clusters and clustered the individuals with high similarity. Collaborative filtering technique is applied to predict among each of the K clusters, and recommendation predictions are made for target users based on the prediction levels obtained from clustering. Bo and Fei [2] used a combined collaborative filtering recommendation algorithm to improve the accuracy utilization of group buying websites using an offline testing method [1316].

2.3.2. Convolutional Neural Network

Convolutional neural networks (CNNs) are one of the main focuses of research in deep learning [17, 18], and their applications in image processing are quite mature, and they are also widely used for processing text comments. As a feedforward neural network, the basic structure of the CNN is similar to that of other neural networks in that it consists of an input layer, an implicit layer [1925], and an output layer for data feature extraction, and the implicit layer of the CNN consists of three layers, including convolution, pooling, and full connectivity [3]. The CNN structure is shown in Figure 1, including the convolution layer, pooling layer, and fully connected layer, which are the important neural network structures in this paper.

The purpose of this paper is to design a personalized night tour recommendation model, and to address the problem of data sparsity where it is difficult to mine deep information based on user collaborative filtering recommendation algorithms, convolutional neural networks are selected to classify the night attraction images and review information of tour data for deep extraction. The text comments of tourists on tourism contain emotional factors about the tourism process, which are divided into two categories: positive and negative. The basic information, behavioral information, and contextual information of tourist users are combined to form tourist user data to solve the problem of single data.

In this paper, in addition to the night landscape features after data enhancement, text features are also required in the tourism recommendation model, which mainly considers three major elements of user data: basic information, behavioral information, and contextual information. The vectorized tourism user review data matrix is sent to the convolutional neural network for training to get the positive and negative emotions of tourists towards the project, and then the processed tourism data are used for similarity calculation. The structure of the travel recommendation model is shown in Figure 2.

The basic information of the user is expressed as

The behavioral information of travel users is expressed as

The emotional information of travel users is expressed as

The textual feature information of the night tour recommendation information is expressed as

3. Results and Discussion

3.1. Experimental Results of a Night Image Improvement Algorithm Based on Histogram Equalization

In the experiment, the images of night tourist attractions are selected, and the traditional histogram equalization and the three improved histogram equalization methods proposed in this paper are carried out, respectively, and the corresponding histograms are given. The comparison graph of the image enhancement results of the three improved algorithms is shown in Figure 3.

In addition to the visual comparison of the results, this paper provides a table of numerical comparisons of different algorithms, as shown in Table 1. According to the results of the above experimental images, the improved histogram equalization method has a more obvious contrast of the enhanced images. From the experimental data, the enhanced histogram equalization method enlarges the grayscale range of the image. In addition, the average value of the image is closer to the actual value.

3.2. Analysis of Travel Recommendation Results after Night Image Enhancement

In this paper, we crawled the nighttime attraction pictures of China 5A and 4A, a total of 32 attractions on the Internet and the rating data set on tourism websites. Then, the text features are extracted: first, the duplicate data, blank data, and invalid data of irrelevant scenic spots are removed. Then, the noisy data are filtered; that is, the nontext symbols are removed. Then, we use Python’s jieba to split the word for annotation data and filter stop words. Convolutional neural networks have certain requirements on the length of the input vectors, so the length of segmented sentences is standardized. Most of the processed word segmentation data are about 50 in length, so sentences with a length of about 50 are chosen. The data corresponding to each visitor and scenic spot are merged. Then, word2vec vectorization is performed on the merged word segmentation data. The vectorized multidimensional data are sent to the convolutional neural network to extract features.

In order to reflect the effectiveness of the convolutional neural network and collaborative filtering method more intuitively, this experiment compares this method with the traditional collaborative filtering method which only considers the scores between users and items. The experimental results are shown in Figure 4. It can be seen that the MAE value of this paper is smaller than that of the collaborative filtering method in the same scene, considering the behavior information and context data of tourists. As the data volume in the test set increases, the MAE value increases, but the overall trend decreases, which indicates that when the data volume is more significant, the quality of the model can be fully verified.

4. Conclusions

Night travel recommendation, as an essential part of travel recommendation, is often ignored due to low light. However, with the optimization of intelligent image processing technology, it has been paid much attention. In digital image processing, image enhancement technology plays an important role in improving image quality. It is the preprocessing stage of image processing, which plays the role of carrying forward and preparing for the subsequent processing stages. Firstly, the basic theories and algorithms of image enhancement are introduced. Secondly, this paper lists the related improvements made in view of the shortcomings of traditional histogram equalization methods and analyzes the advantages of each improvement. Finally, a better night travel recommendation system is proposed by combining collaborative filtering and convolutional neural network.

Data Availability

The experimental data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest regarding this work.

Acknowledgments

This work was sponsored in part by the Scientific Research Project for Universities of Inner Mongolia Education Department (no. NJSY21022).