Style-Based Neural Architectures for Real-Time Weather Classification PubID: pubid: Funded by the European Union (grant no. 101069576). However, the opinions and points of view expressed are solely those of the author(s). Hamed Ouattara, Pierre Duthon, Frédéric Bernardin, and Pascal Salmane are with Cerema, Intelligent Transportation Systems Research Team, France. Omar Ait Aider is with Institut Pascal, France.
Hamed Ouattara, Pierre Duthon, Frédéric Bernardin, Omar Ait Aider, Pascal Salmane · 2026
Read Style-Based Neural Architectures for Real-Time Weather Classification PubID: pubid: Funded by the European Union (grant no. 101069576). However, the opinions and points of view expressed are solely those of the author(s). Hamed Ouattara, Pierre Duthon, Frédéric Bernardin, and Pascal Salmane are with Cerema, Intelligent Transportation Systems Research Team, France. Omar Ait Aider is with Institut Pascal, France. by Hamed Ouattara, Pierre Duthon, Frédéric Bernardin, Omar Ait Aider, Pascal Salmane (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-18251.txt.
Introduction
Ouattara, Salmane, Duthon, Bernardin, and Ait Aider build three neural networks that classify weather in photos in real time. The models chase stylistic image cues to tell sunny, rain, snow, and fog apart. One adapts PatchGANs with several patch sizes, one truncates ResNet50 to its first nine layers, and one adds Gram matrices with attention weighting. The two truncated models beat the state of the art and generalize well, and the designs also suit other appearance-based tasks such as defect spotting.
Catalog record
| CREATOR | Hamed Ouattara, Pierre Duthon, Frédéric Bernardin, Omar Ait Aider, Pascal Salmane |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 28610 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.18251
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Style-Based Neural Architectures for Real-Time Weather Classification PubID: pubid: Funded by the European Union (grant no. 101069576). However, the opinions and points of view expressed are solely those of the author(s). Hamed Ouattara, Pierre Duthon, Frédéric Bernardin, and Pascal Salmane are with Cerema, Intelligent Transportation Systems Research Team, France. Omar Ait Aider is with Institut Pascal, France. Hamed Ouattara, Pierre Duthon, Frédéric Bernardin, Omar Ait Aider, Pascal Salmane Abstract In this paper, we present three neural network architectures designed for real-time classification of weather conditions (sunny, rain, snow, fog) from images. These models, inspired by recent advances in style transfer, aim to capture the stylistic elements present in images. One model, called “Multi-PatchGAN,” is based on PatchGANs used in well-known architectures such as Pix2Pix and CycleGAN, but here adapted with multiple patch sizes for detection tasks. The second model, “Truncated ResNet50,” is a simplified version of ResNet50 retaining only its first nine layers. This truncation, determined by an evolutionary algorithm, facilitates the extraction of high-frequency features essential to capture subtle stylistic details. Finally, we propose “Truncated ResNet50 with Gram Matrix and Attention,” which computes Gram matrices for each layer during training and automatically weights them via an attention mechanism, thus optimizing the extraction of the most relevant stylistic expressions for classification. These last two models outperform the state of the art and demonstrate remarkable generalization capability on several public databases. Although developed for weather detection, these architectures are also suitable for other appearance-based classification tasks, such as animal species recognition, texture classification, disease detection in medical imaging, or industrial defect identification. I Introduction Real-time detection of weather conditions from images is crucial, as weather directly influences human and animal activities. In automated agriculture, irrigation systems, harvesting robots, or spraying drones could benefit from this technology. In the energy sector, where weather affects the production of renewable energies (solar, wind, hydroelectric), real-time weather tracking would make it possible to optimize resource usage based on weather conditions. Given the extensive coverage of cameras (urban surveillance, road networks, satellite imagery), such an algorithm could provide reliable data even in areas without weather stations, thereby enhancing climate models and alert systems. Another major advantage of these algorithms lies in their potential use in autonomous vehicles, enabling immediate adaptation of driving to weather conditions. We define the style of an image as the appearance of the objects it contains. This appearance can vary according to several factors such as brightness, shapes, or textures of objects, etc. Thus, in this paper, we hypothesize that weather conditions contribute to the style of an image by influencing the overall appearance of the objects it contains. Indeed, a sunny scene reveals objects in vivid colors, reflecting the broad wavelengths of sunlight. Conversely, during a storm, objects appear duller and more reflective because they are wet. In a foggy scene, object outlines fade, while in a snowy landscape, objects appear uniform due to the whiteness of the snow. In the same way that two painters representing the same scene each paint it in their own style, two different weather conditions give the same scene a distinct appearance specific to each one ( Fig. 1 ). Style transfer algorithms enable transferring the appearance of one set of images to another and have made remarkable progress in recent years [ 17 , 46 , 27 , 6 , 36 , 41 , 38 , 43 , 19 , 23 , 14 , 3 , 47 , 35 , 37 , 13 , 1 , 32 , 30 ] . Based on our hypothesis—“weather mainly affects the appearance of objects in an image”—it becomes relevant to explore these algorithms for weather detection and compare them to more traditional methods. Indeed, they can detect and exchange styles between two different image sets, for example transforming photographs into images imitating an artist’s style [ 6 ] , or simulating various weather conditions [ 46 ] . An example using the CycleGAN model is illustrated in ( Fig. 1 ). Our model codes are available here: code . Fig. 1 : Example of simulating weather conditions using the CycleGAN algorithm. II Contributions and Paper Organization In this paper, we discuss the main contributions [ 17 , 46 , 27 , 6 ] on style transfer, focusing on how neural network architectures extract stylistic information from an image, particularly weather-related features, to leverage their potential in weather detection. The ability of these architectures to transfer stylistic features from one set of images to another is only useful here for visualizing the information they detect. We compare three architectures inspired by recent advances in style transfer to achieve real-time automatic detection of weather conditions (rain, snow, fog, sun). The “Truncated ResNet50” and “Truncated ResNet50 + Gram Matrix + Attention” models ( the latter introduces, for the first time, a learned selection of Gram matrices ) match or exceed the state-of-the-art, displaying strong generalization capabilities, with an F1 score of 98.85% in tests. We also demonstrate their potential for other applications, such as disease detection in medical imaging ( Application of our models to other tasks ). III Literature Review As mentioned in the introduction, we propose using architectures stemming from style transfer algorithms for detection tasks. These approaches will be compared (see Table II in Section VI ) to standard detection methods, whose literature review is presented in Section III.B. III-A Review of Style Transfer Methods or Heuristics III-A 1 Neural Style Transfer and the Work of Leon A. Gatys et al. [ 6 ] Leon A. Gatys et al. [ 6 ] , pioneers in neural style transfer, propose to factorize an image ( Fig. 2 ) by separating its content (objects, animals, etc.) from its style, or the appearance of the objects, which can vary based on factors such as brightness, contrast, or colors. Gatys demonstrates that the high-level layers of a neural network pre-trained for classification or detection tasks effectively capture the presence of objects regardless of their appearance ( Fig. 3 ). Indeed, these networks are designed to robustly recognize objects under different conditions, often by means of data augmentation. Furthermore, Gatys shows that the style or appearance of objects can be extracted by examining the correlations [ 6 ] , [ 7 ] among the feature maps of the same layer in a neural network. Each layer may contain several filters, each generating a feature map indicating that filter’s activation across different locations of the image. The idea is that the stylistic elements defining the appearance of objects can be captured through correlations (or similarities) between these feature maps, reflecting the overall relationships among the patterns present in the image. To obtain these correlations, Gatys proposes computing the Gram matrix , which corresponds to the dot product of vectorized feature maps in the same layer. It is equivalent to the covariance matrix in statistics. \mathbf{G}=\begin{bmatrix}c_{1}\cdot c_{1}&c_{1}\cdot c_{2}&c_{1}\cdot c_{3}\\ c_{2}\cdot c_{1}&c_{2}\cdot c_{2}&c_{2}\cdot c_{3}\\ c_{3}\cdot c_{1}&c_{3}\cdot c_{2}&c_{3}\cdot c_{3}\end{bmatrix} Gram matrix: This matrix represents the correlations between the vectorized feature maps c_{i} of a layer containing three filters. Each entry c_{i}\cdot c_{j} is the dot product between the feature vectors c_{i} and c_{j} . It is important to note that Gram matrices from lower-level layers capture