Prediction of E. Coli concentration at Saint-Quentin Island beach

City of Trois-Rivières

Summers 2020 and 2021

The City of Trois-Rivières is responsible for the Saint-Quentin Island beach, a heavily used beach located at the mouth of the Saint-Maurice and St. Lawrence Rivers. The city is very proactive in ensuring the safe use of the beach for bathers. However, like most urban beaches, this beach is affected by point source contamination when the water quality standard of 200 CFU per 100 millilitres of water is exceeded.


With traditional water quality measurement methods, a sample must be taken directly from the shore and then brought to the laboratory for analysis. An incubation time of several hours is then required to estimate the number of Ecoli colonies in the sample to determine if the water is safe for swimming. Therefore, the long delay in obtaining a result means that beaches are sometimes open when they should be closed and that the beach may be closed as a precautionary measure when it is safe. In addition, since sampling is a highly time-consuming task, it is done sporadically. Therefore, managers must often base their decisions regarding beach closure on results that are several days old.

Another important challenge at Île Saint-Quentin beach is the effect of the St. Lawrence River which often brings contaminated water to the beach. It is therefore important to take into account the effect of the river in order to adequately predict water quality at the beach.


CANN Forecast has developed a model, InteliSwim, to predict water quality in real time using various open data and data provided by the city, such as conductivity to characterize the effect of the St. Lawrence River on the beach.

Four steps

  1. The city sends historical data for E.coli sampling, precipitation and conductivity and CANN Forecast collects other variables of interest, such as wind, temperature and flow of the St. Maurice River.
  2. CANN Forecast trains artificial intelligence models to learn the non-linear relationships between environmental variables and fecal contamination at the beach.
  3. The trained model is then tested in real-world situations to assess whether it can correctly predict beach opening and closing.
  4. The model is re-trained with new data at the end of each summer season to increase its accuracy.
« With CANN Forecast’s innovative artificial intelligence-based approach, we used InteliSwim to predict water quality accurately at our beach. It was a great experience working with the team. »

Julien St-Laurent
Head of Department, City of Trois-Rivières


of contaminations identified in 2021


of safe days identified in 2021


of contaminations identified in 2022


of safe days identified in 2022

The water quality model was tested during the summer in 2021 and 2022*. Excluding sites with unexplained chronic contamination, the rate of beach contamination in both years was relatively low (9% and 6% of the summer period respectively). To objectively evaluate the performance of the water quality model, we compared the model’s decisions to displays based on the last available sample (persistence). The comparison between the two approaches was done for false positives (the beach is closed when it should be open) and false negatives (the beach is open when it should be closed).

For the beach, the model correctly predicted 3 of the 4 contaminations in 2021 (compared to 1 for persistence) and the 2 contaminations in 2023 (versus 0 for persistence). In 2021, the model correctly identified 77% of safe days (compared to 89% for persistence) and 70% in 2022 (compared to 93% for persistence). In conclusion, the model is really more accurate in identifying contamination, but causes more unnecessary closures: 5 in 2021 and 7 in 2022.

* Because of persistent contamination at some beach sites, we used only the uncontaminated sites.