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 for capturing 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.
翻译:本文提出了三种专为实时天气状况(晴天、雨天、雪天、雾天)图像分类设计的神经网络架构。这些模型借鉴了风格迁移领域的最新进展,旨在捕捉图像中的风格化元素。第一种模型称为"Multi-PatchGAN",它基于Pix2Pix和CycleGAN等知名架构中使用的PatchGAN,但为检测任务调整了多尺度补丁大小。第二种模型"Truncated ResNet50"是ResNet50的简化版本,仅保留其前九层,这种由进化算法确定的截断策略有利于提取捕捉细微风格细节所需的高频特征。最后,我们提出"带有Gram矩阵与注意力机制的Truncated ResNet50",该模型在训练过程中为每个层计算Gram矩阵,并通过注意力机制自动为其分配权重,从而优化了分类任务中最相关风格表达的提取。后两个模型在多个公开数据库上超越了现有技术水平,并展现出卓越的泛化能力。尽管这些架构专为天气检测而开发,但它们同样适用于其他基于外观的分类任务,如动物物种识别、纹理分类、医学影像疾病检测或工业缺陷识别。