However, a CNN usually requires a large training dataset to optimize a large number of parameters in the network and establish the complex nonlinear mapping relationships that are required. It is difficult to acquire sufficient field data for use as training data, and this greatly limits the use of machine learning methods in predicting population diversity. Recent rapid improvements in computing power have led to research focused on developing deep generative models that learn from the probability densities of observable samples and randomly generate new samples. The most influential recently developed generative models are the variational autoencoder (VAE) and the generative adversarial network (GAN), which have very successfully solved problems caused by insufficient data. [PERSON] et al. [26] addressed the unbalanced learning problem by developing a VAE-based method for generating synthetic data. The method generates a large number of similar samples from the original dataset and evaluates and compares the samples using traditional synthesis methods. [PERSON] et al. [27] used a GAN to generate a large number of fault samples, establish a balanced dataset, and diagnose faults in induction motors. [PERSON] et al. [28] used a GAN to reconstruct missing seismic data, learn the distribution characteristics of the original data through an adversarial process in a neural network, and reconstruct severely under-sampled seismic data. Insects are a very large group of biota and are often used to assess the ecological environment. Changes in aquatic ecosystems, whether natural or anthropogenic, can lead to changes in the relative abundance of certain groups of aquatic insects [29]. Most insect species live in different habitats during their egg, larval, pupal, and adult stages, so it is very common that an insect community will have a different composition in different seasons. Data on insect communities are also strongly affected by random factors that affect field sampling. This makes it difficult to reliably predict the composition of an insect community. The third author of this paper and his co-workers found that there is a correlation between the diversity of aquatic beetles and environmental factors within a certain range of areas based on the studies of Chinese fauna of aquatic beetle diversity for more than 20 years [30; 31; 32; 33; 34; 35]. It is possible to know the diversity of aquatic insects by monitoring environmental factors. It is a very challenging and complex task. Few studies in which the compositions of insect communities have been predicted have been performed. Many aquatic insects live in a single water body for at least one stage of their life history and do not tend to migrate long distances. The aquatic habitats of aquatic insects mean that sampling is less affected by various factors for aquatic than for other insects. ANNs can therefore be used to study aquatic insect community richness [1; 2; 36; 37; 38]. However, ANN models have not yet been used to predict the number of species or the number of individuals in insect communities. Ecological factors have different effects on the compositions of aquatic insect communities in aquatic systems in different geographical areas. There are regional limitations on research into insect community predictions, and different ecological factors should be used as variables when making predictions for different regions and environments. In this study, a 1-D CNN was used to identify the relationships between the aquatic beetle community composition and important ecological factors in a hydrostatic environment in Guangdong Province (East China) using experimental data for aquatic beetles acquired at the study site for one year. The 1-D CNN simultaneously predicted the aquatic beetle community richness and diversity, which can achieve the multi-variable output. To improve the accuracy of prediction, this paper built a CNN model combined with a Bayesian optimization algorithm and optimized the input parameters to build the optimal CNN model.