Skip to content

Commit e109477

Browse files
authored
Fixes for russian language (#22)
- Instructions to examples were added - Russian comments was created
1 parent 13097ef commit e109477

27 files changed

+7028
-577
lines changed

README.md

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# TorchCNNBuilder
32
<p align="center">
43

@@ -16,7 +15,15 @@
1615
</div>
1716

1817
---
19-
**TorchCNNBuilder** is an open-source framework for the automatic creation of CNN architectures. This framework should first of all help researchers in the applicability of CNN models for a huge range of tasks, taking over most of the writing of the architecture code. This framework is distributed under the 3-Clause BSD license. All the functionality is written only using `pytorch` *(no third-party dependencies)*.
18+
### Description in Russian is presented [here](README_RU.md).
19+
20+
---
21+
22+
**TorchCNNBuilder** is an open-source framework for the automatic creation of CNN architectures.
23+
This framework should first of all help researchers in the applicability of CNN models for a
24+
huge range of tasks, taking over most of the writing of the architecture code.
25+
This framework is distributed under the **3-Clause BSD license**. All the functionality is written
26+
only using `pytorch` *(no third-party dependencies)*.
2027

2128
### Installation
2229

@@ -26,6 +33,21 @@ The simplest way to install framework is using `pip`:
2633
pip install torchcnnbuilder
2734
```
2835

36+
<details><summary>Additional packages for examples run</summary>
37+
38+
Please note that when running examples from the [examples](examples) folder,
39+
additional libraries are used to visualize and generate the dataset:
40+
41+
```
42+
pip install numpy
43+
pip install pytorch_msssim
44+
pip install matplotlib
45+
pip install tqdm
46+
```
47+
48+
They are not required for the library to work, so their installation is optional.
49+
50+
</details>
2951

3052
### Usage
3153

@@ -69,6 +91,61 @@ lint: Lint the project with flake8 lib.
6991
doc: Build and run the doc locally.
7092
```
7193
94+
### Application Areas
95+
96+
TorchCNNBuilder enables CNN architectures for diverse real-world applications across multiple domains:
97+
98+
#### Environmental Monitoring
99+
100+
- **Sea ice concentration forecasting**
101+
Predict Arctic and Antarctic ice melt patterns to support climate research and maritime navigation safety using satellite imagery time series.
102+
103+
- **Climate pattern recognition**
104+
Analyze large-scale atmospheric data to identify emerging weather patterns, extreme event precursors, and long-term climate trends.
105+
106+
- **Pollution level prediction**
107+
Process multispectral sensor data to forecast air/water quality indices and identify pollution sources with spatial CNN architectures.
108+
109+
#### Remote Sensing
110+
111+
- **Satellite image analysis**
112+
Process high-resolution multispectral imagery for applications ranging from urban planning to precision agriculture using specialized encoder architectures.
113+
114+
- **Land cover classification**
115+
Automate large-scale terrain mapping with attention-based CNNs that handle spectral, spatial and temporal dimensions of data.
116+
117+
- **Disaster monitoring**
118+
Develop change detection systems that compare pre/post-event satellite imagery to assess flood, fire or earthquake damage in near-real-time.
119+
120+
121+
#### Medical Imaging
122+
123+
- **Automated diagnosis from X-ray/MRI scans**
124+
Develop assistive diagnostic systems that can detect abnormalities in medical images with pixel-level precision while reducing radiologist workload.
125+
126+
- **Tumor segmentation**
127+
Create 3D convolutional networks for precise volumetric analysis of cancerous growths in CT/MRI scans.
128+
129+
- **Medical time-series analysis**
130+
Process sensor streams to predict patient deterioration through temporal features processing architectures.
131+
132+
#### Industrial Applications
133+
134+
- **Predictive maintenance**
135+
Monitor equipment vibration patterns and thermal signatures to forecast mechanical failures.
136+
137+
- **Quality control in manufacturing**
138+
Implement real-time visual inspection systems that detect defects in production lines.
139+
140+
141+
#### Financial Forecasting
142+
143+
- **Time-series prediction**
144+
Build hybrid CNN-LSTM architectures that extract both spatial patterns from market heatmaps and temporal dependencies from price histories.
145+
146+
- **Market trend analysis**
147+
Process alternative data sources like satellite images of parking lots or social media sentiment through CNN architectures.
148+
72149
### Sources
73150
74151
---

README_RU.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# TorchCNNBuilder
2+
<p align="center">
3+
4+
<img src=".docs/media/logo_transparent_h.PNG" width="600">
5+
</p>
6+
7+
<div id="badges">
8+
<a href="https://pytorch.org/">
9+
<img src="https://img.shields.io/badge/pytorch-CB2C31?style=flat&logo=pytorch&logoColor=white" alt="pytorch badge"/>
10+
</a>
11+
<img alt="Dynamic JSON Badge" src="https://img.shields.io/pypi/pyversions/torch">
12+
<a href="https://badge.fury.io/py/torchcnnbuilder">
13+
<img src="https://badge.fury.io/py/torchcnnbuilder.svg" alt="PyPI version" height="18">
14+
</a>
15+
</div>
16+
17+
---
18+
**TorchCNNBuilder** — это фреймворк с открытым исходным кодом для автоматического
19+
создания архитектур CNN. В первую очередь он предназначен для исследователей,
20+
работающих с CNN, и берёт на себя большую часть написания кода архитектуры.
21+
Распространяется под **лицензией 3-Clause BSD**.
22+
Вся функциональность реализована исключительно на `pytorch` *(без сторонних зависимостей)*.
23+
24+
### Установка
25+
26+
---
27+
Проще всего установить фреймворк через `pip`:
28+
```
29+
pip install torchcnnbuilder
30+
```
31+
32+
<details><summary>Доп.пакеты для примеров</summary>
33+
34+
Обратите внимание, что при запуске примеров из папки [examples](examples) для визуализации
35+
и формирования набора данных используются дополнительные библиотеки:
36+
37+
```
38+
pip install numpy
39+
pip install pytorch_msssim
40+
pip install matplotlib
41+
pip install tqdm
42+
```
43+
44+
Они не требуются для работы библиотеки, поэтому их установка не обязательна.
45+
46+
</details>
47+
48+
### Использование
49+
50+
Для инициализации простой модели с архитектурой "кодировщик-декодировщик" используйте класс ```ForecasterBase```:
51+
```python
52+
from torchcnnbuilder.models import ForecasterBase
53+
54+
model = ForecasterBase(input_size=[H, W],
55+
in_time_points=C_in,
56+
out_time_points=C_out,
57+
n_layers=5)
58+
```
59+
Где ```[H, W]``` - размер изображения в пикселях, ```C_in``` - количество входных каналов, ```C_out``` - количество выходных каналов.
60+
61+
Для раздельной работы с кодировщиком и декодировщиком их можно вызвать из модели:
62+
```python
63+
encoder = model.encoder
64+
decoder = model.decoder
65+
```
66+
67+
### Примеры
68+
69+
Сценарии использования можно найти в папке [examples](examples).
70+
71+
Примеры вызова компонентов — в папке [usage_examples](examples/usage_examples).
72+
73+
74+
### Документация
75+
76+
Документация доступна [по ссылке](https://chrislisbon.github.io/TorchCNNBuilder/torchcnnbuilder.html).
77+
78+
### Разработчикам
79+
80+
Для просмотра доступных команд `Makefile` выполните в корне проекта:
81+
```sh
82+
make help
83+
```
84+
```yaml
85+
help: Показать справку по командам Makefile.
86+
lint: Проверить код с помощью flake8.
87+
doc: Собрать и запустить документацию локально.
88+
```
89+
90+
### Направления прикладного использования
91+
92+
TorchCNNBuilder позволяет создавать CNN-архитектуры для различных практических задач:
93+
94+
#### Мониторинг окружающей среды
95+
96+
- **Прогнозирование концентрации морского льда**
97+
Предсказание ледовых условий в Арктике и Антарктике для климатических исследований и безопасности судоходства.
98+
99+
- **Прогнозирование климатических условий**
100+
Анализ атмосферных данных, а также их предсказание для оценки погодных явлений.
101+
102+
- **Прогнозирование уровня загрязнения**
103+
Обработка данных сенсоров для предсказания и оценки качества воды и воздуха.
104+
105+
#### Дистанционное зондирование
106+
107+
- **Анализ спутниковых снимков**
108+
Обработка мультиспектральных изображений для сельского хозяйства и градостроительства.
109+
110+
- **Классификация подстилающей поверхности Земли**
111+
Автоматическое картирование территории на основе CNN, агрегирующей спектральную, пространственную и временную размерности данных.
112+
113+
- **Мониторинг природных бедствий**
114+
Системы детектирования изменений на основе оценки состояния природных сред по спутниковым изображениям до и после события.
115+
К примеру наводнений, пожаров или землетрясений.
116+
117+
118+
#### Медицинские изображения
119+
120+
- **Автоматическая диагностика по рентгену/МРТ**
121+
Системы для обнаружения аномалий на медицинских изображениях, позволяющие сократить работу мед. персонала.
122+
123+
- **Сегментация опухолей**
124+
Создание 3D CNN для многомерного анализа медицинских данных.
125+
126+
- **Анализ медицинских временных рядов**
127+
Обработка потоковых данных для прогнозирования ухудшения состояния пациентов за счет временных признаков.
128+
129+
#### Предиктивное обслуживание
130+
131+
- **Прогностическое обслуживание**
132+
Мониторинг вибраций обоорудования и тепловых сигнатур для прогнозирования механических отказов.
133+
134+
- **Контроль качества на производстве**
135+
Внедрение систем визуального контроля в реальном времени, которые обнаруживают дефекты на производственных линиях.
136+
137+
138+
#### Финансовое прогнозирование
139+
140+
- **Прогнозирование временных рядов**
141+
Создание гибридных архитектур CNN-LSTM, которые извлекают как пространственные
142+
закономерности из тепловых карт рынка, так и временные зависимости из истории цен.
143+
144+
- **Анализ рыночных тенденций**
145+
Обработка альтернативных пространственно-временных источников данных, таких как спутниковые снимки парковок или настроения в
146+
социальных сетях, с помощью архитектур CNN.
147+
148+
149+
### Источники
150+
151+
---
152+
- [Forecasting of Sea Ice Concentration using CNN, PDE discovery and Bayesian Networks](https://www.sciencedirect.com/science/article/pii/S1877050923020094)
153+
- [Surrogate Modelling for Sea Ice Concentration using Lightweight Neural Ensemble](https://arxiv.org/abs/2312.04330)
154+
- [Пост о разработке и применении фреймворка на habr.com ](https://habr.com/ru/companies/selectel/articles/818649/)
155+
156+
157+
### Как поучаствовать в проекте
158+
159+
- Чтобы присоединиться к команде [напишите нам](mailto:jul.borisova@itmo.ru);
160+
161+
- [Issues](https://github.com/ChrisLisbon/TorchCNNBuilder/issues) и
162+
[Pull Requests](https://github.com/ChrisLisbon/TorchCNNBuilder/pulls): для пометки багов и запросов на добавление функций.
163+
164+
### Благодарности
165+
166+
Проект реализуется при поддержке [ФСИ](https://fasie.ru/) - Фонда содействия инновациям.

examples/README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1+
[[Click For Russian version]](README_RU.md)
2+
13
# Usage examples
24

35
Relevant usage examples can be found in this directory. The API examples of each submodule are located in the corresponding `ipynb` file:
4-
- [`torchcnnbuilder`](./examples.ipynb) - main constants and convolution formulas
5-
- [`torchcnnbuilder.builder`](./builder_examples.ipynb) - builder API for the creation of convolution sequences
6-
- [`torchcnnbuilder.models`](./model_examples.ipynb) - examples of adaptive models created with builder API
7-
- [`torchcnnbuilder.preprocess`](./preprocess_examples.ipynb) - data preprocessing
6+
- [`torchcnnbuilder`](usage_examples/main_examples.ipynb) - main constants and convolution formulas
7+
- [`torchcnnbuilder.builder`](usage_examples/builder_examples.ipynb) - builder API for the creation of convolution sequences
8+
- [`torchcnnbuilder.models`](usage_examples/model_examples.ipynb) - examples of adaptive models created with builder API
9+
- [`torchcnnbuilder.preprocess`](usage_examples/preprocess_examples.ipynb) - data preprocessing
10+
11+
## Lightweight domain examples
12+
13+
Examples of models building and training:
14+
- [`synthetic_noise_examples`](synthetic_noise_examples) - Architecture selection and noise resistance experiment
15+
- [`anime_example`](anime_example.ipynb) - Media-content example
16+
- [`ice concentration`](ice_concentration) - ice concentration example
17+
- [`moving mnist example`](moving_mnist_example.ipynb) - MovingMnist dataset example
18+
19+
20+
[`speed device test`](speed_device_test.py) - demonstrate time of building and device usage
21+
22+
23+
24+
Step-by-step examples description presented in ipynb cells and code comments.

examples/README_RU.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Примеры использования
2+
3+
## Примеры работы с компонентами библиотеки
4+
Примеры обращения в API для каждого подмодуля расположены в соответствующих файлах `ipynb`:
5+
- [`torchcnnbuilder`](usage_examples/main_examples_ru.ipynb) - основные переменные и мат. аппартат сверток
6+
- [`torchcnnbuilder.builder`](usage_examples/builder_examples_ru.ipynb) - API класса-строителя для создания последовательностей сверток
7+
- [`torchcnnbuilder.models`](usage_examples/model_examples_ru.ipynb) - примеры моделей, созданных с помощью API класса-строителя
8+
- [`torchcnnbuilder.preprocess`](usage_examples/preprocess_examples_ru.ipynb) - функции подготовки данных
9+
10+
## Прикладные легковесные примеры
11+
12+
Примеры сборки и обучения моделей:
13+
- [`synthetic_noise_examples`](synthetic_noise_examples) - Эксперимент по подбору архитектуры и оценки устойчивости к шуму
14+
- [`anime_example`](anime_example_ru.ipynb) - Пример на данных с медиа-контентом
15+
- [`ice concentration`](ice_concentration) - Пример на данных о концентрации льда
16+
- [`moving mnist example`](moving_mnist_example_ru.ipynb) - Пример для датасета MovingMnist
17+
18+
19+
[`speed device test`](speed_device_test.py) - демонстрирует скорость сборки модели и использование CPU и CUDA
20+
21+
Пошаговое описание примеров представлено в ячейках ноутбуков и в виде комментариев к коду.
22+

examples/anime_example.ipynb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
{
22
"cells": [
3+
{
4+
"metadata": {},
5+
"cell_type": "markdown",
6+
"source": "***This notebook use additional modules for models output and training process visualization, please install them if they are not exist in your environment***",
7+
"id": "4833fb70b22e113b"
8+
},
9+
{
10+
"metadata": {},
11+
"cell_type": "code",
12+
"outputs": [],
13+
"execution_count": null,
14+
"source": [
15+
"!pip install numpy\n",
16+
"!pip install tqdm\n",
17+
"!pip install matplotlib \n",
18+
"!pip install pillow"
19+
],
20+
"id": "9a0fa490fe399727"
21+
},
322
{
423
"metadata": {},
524
"cell_type": "markdown",

0 commit comments

Comments
 (0)