Collecting a custom dataset in a real-world environment
Off-the-shelf, open-source datasets did not meet the project's requirements. Most available trash-related datasets are focused on streets and urban environments, whereas an office differs significantly in terms of background, object scale, and the context of their use.
Therefore, data was collected directly within the Lomonosov Cluster. Bottles, cups, napkins, bags, and other items that could potentially be interpreted as abandoned trash were placed in the monitored zones. Their positions were changed regularly so that the model could capture various combinations of angles, distances, and surrounding objects.

Filming was conducted simultaneously from multiple cameras. This allowed for the collection of approximately 10,000 frames and ensured the dataset included real-world characteristics: different viewing angles, lighting conditions, perspective distortions, and partial occlusions.
Unlike training on a universal dataset, this approach allowed us to adapt the computer vision model directly to the environment in which it was intended to operate.
Training the object recognition model
The collected images were labeled by object class and then used to train the detector. The dataset included bottles, cups, backpacks, and other items commonly found in an office space.
A separate technical challenge involved handling small objects. The source images came from Full HD cameras, while the model operated at a resolution of 640 × 640 pixels. Simply downscaling the full frame would have led to a loss of detail: a small bottle or cup might occupy too few pixels for reliable detection.

Therefore, the source frame was divided into six sections, each of which was analyzed separately. After processing, the results were merged. This mechanism allowed us to maintain the necessary level of detail without resorting to more computationally intensive processing of the entire Full HD frame.
Detecting trash with context awareness
The main algorithmic complexity of the project lay not in detecting an object, but in interpreting the situation surrounding it.

A plastic cup on an empty table might be abandoned trash. The same cup next to a person sitting at the table is most likely in use. If the system relied solely on the object class, it would frequently generate false alarms.
To solve this problem, two neural networks were used: one identifies potential trash, and the other identifies people. After detection, the system analyzes the relative positioning of the objects. If potential trash is located within an extended area around a person, the event is not flagged as a cleaning requirement.
It is this layer of application logic that transforms object recognition into computer vision for a specific business process: the model's output is further interpreted based on what is happening in the room.
Excluding zones with a high risk of false positives
Not all areas of the room needed to be analyzed in the same way. For example, near a coffee station, cups may temporarily be on a surface as part of normal staff operations. Formally, the model sees the target object class, but it would be incorrect to create a cleaning task based on that.

Spatial masks were implemented for such areas. When setting up the camera, regions are defined within the frame where events are excluded from analysis.
Because of this, computer vision systems can be adapted not only to a specific facility but also to the operational rules of individual zones within the same room.
Working with multiple cameras
At the facility, the same zone could simultaneously fall within the field of view of several cameras. This increased space coverage but created another problem: a single physical object could be detected from different angles, generating multiple identical events.
When configuring the system, the priority of data from different cameras was taken into account. Additionally, filtering for duplicate events was implemented: if an item remains in one place for a long time and the situation does not change, the system does not create new records for each subsequent detection.
As a result, the stream of detections is transformed into a set of meaningful events that maintenance staff can act upon.
Unified video analytics framework
A backend was developed for the project using FastAPI, deployed in a Docker container. The system receives video streams from existing cameras via RTSP, sends images for neural network processing, and saves information about significant events in PostgreSQL.
The backend further verifies recognition results and filters out repeat detections. If an item remains in one place and the situation does not change, the system does not create new records for each subsequent detection.
This architecture allowed for the implementation of video analytics based on existing camera infrastructure and the creation of a unified framework that can be expanded with new cameras, control zones, and computer vision scenarios.
Web interface and notifications
A web client was implemented to work with the accumulated data. It provides detection statistics by day, camera, and category, allowing camera data to be used not only for reacting to individual events but also for subsequent analysis of space utilization.

A separate Telegram notification system was implemented. When the system determines that cleaning is required, an employee can receive a message with information about where and what object was detected.
Thus, applied video analytics is integrated directly into the workflow: from the camera image to a specific event and the transmission of information to the responsible employee.




