Scene recognition method, system and factory dirtiness identification system

By calculating the mean of the discrimination results of scene image samples and training the model, the noise problem caused by scene complexity and subjectivity of manual labeling in scene recognition is solved, and high-precision and robust scene recognition is achieved, which is suitable for identifying the degree of dirtiness in factory buildings.

CN114694057BActive Publication Date: 2025-09-26SHENGJING INTELLIGENT TECH (JIAXING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210220657.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2025-09-26
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

The scene recognition model based on manual labeling training in the existing technology has the problems of low recognition accuracy and low robustness. Especially in the identification of the dirtiness of factory buildings, the noise impact is relatively large due to the complexity of the scene and the subjectivity of manual labeling.

Method used

By obtaining scene image samples, inputting the initial image recognition model, calculating the mean of the sample discrimination results, and training the model based on the loss function until convergence, the mean of the sample discrimination results is converted into the output of the iterative scene recognition model, solving the noise problems caused by scene complexity and subjectivity of manual labeling.

Benefits of technology

The accuracy and robustness of scene recognition are improved, ensuring that the model can still accurately identify complex scenes without affecting the model's running speed and structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114694057B_ABST
    Figure CN114694057B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of scene recognition technology, and provides a scene recognition method, system, and factory dirtiness discrimination system, wherein the method comprises: acquiring a scene image; inputting the scene image into an image recognition model to obtain a discrimination result based on the scene image; wherein the image recognition model is trained based on sample discrimination results obtained by inputting scene image samples into an initial image recognition model, and a sample discrimination result average obtained by taking the average of a preset number of sample discrimination results. The method is used to address the defects of low recognition accuracy and low robustness caused by scene recognition based on manually labeled training models in the prior art, and to achieve high-precision scene recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of scene recognition technology, and in particular to a scene recognition method and system, and a factory building dirtiness level identification system. Background Art

[0002] Image scene recognition utilizes visual information to automatically process and analyze images, identifying and distinguishing specific scenes (such as a kitchen, a street, or a mountain range). Determining the scene within an image not only facilitates understanding the overall semantic content of the image but also provides a basis for identifying specific objects and events within the image. Therefore, scene recognition plays a crucial role in computer-assisted image understanding. Scene recognition technology can be applied to a wide range of practical problems, such as intelligent image management and retrieval, and factory monitoring.

[0003] Currently, scene recognition is primarily based on simple visual classification, requiring a large amount of manual labeling to accurately label the scene. This is then used to train the corresponding scene classification model. However, scenes in various environments vary in reality, and manual labeling is highly subjective. For example, when determining whether a kitchen meets hygiene requirements through scene recognition, different people have different perceptions of what constitutes hygiene, leading to instability in the labeling. Summary of the Invention

[0004] The present invention provides a scene recognition method, system and factory dirtiness discrimination system, which are used to solve the defects of low recognition accuracy and low robustness caused by scene recognition based on manually labeled training models in the existing technology, and achieve high-precision scene recognition.

[0005] The present invention provides a scene recognition method, comprising:

[0006] Get scene image;

[0007] Inputting the scene image into an image recognition model to obtain a discrimination result based on the scene image;

[0008] The image recognition model is trained based on a sample discrimination result obtained by inputting scene image samples into an initial image recognition model and a sample discrimination result mean obtained by averaging a preset number of the sample discrimination results.

[0009] According to the scene recognition method of the present invention, acquiring a scene image includes:

[0010] Get scene video;

[0011] The scene video is extracted frame by frame to obtain the scene image.

[0012] The scene recognition method according to the present invention further includes a training method for the image recognition model:

[0013] Get scene image samples;

[0014] Inputting the scene image sample into the initial image recognition model to obtain the sample discrimination result;

[0015] When the number of the sample discrimination results reaches the preset number, averaging the sample discrimination results to obtain a sample discrimination result mean;

[0016] Calculating a loss function based on each of the sample discrimination results and the mean of the sample discrimination results;

[0017] Training the initial image recognition model based on the loss function, and determining whether the trained initial image recognition model has converged;

[0018] If yes, the trained initial image recognition model is used as the image recognition model;

[0019] If not, return to reacquire new scene image samples to continue training the trained initial image recognition model.

[0020] According to the scene recognition method of the present invention, obtaining scene image samples includes:

[0021] Extracting scene video samples frame by frame to obtain scene image samples belonging to the same preset scene type;

[0022] The image recognition model is trained based on the sample discrimination results and the mean of the sample discrimination results obtained from the scene image samples belonging to different preset scene types; and the number of each type of scene image samples is comparable.

[0023] According to the scene recognition method of the present invention, before the number of the sample discrimination results reaches the preset number, the method further includes:

[0024] Calculating a loss function based on the sample discrimination result and a pre-labeled label corresponding to the scene image sample for obtaining the sample discrimination result;

[0025] Training the initial image recognition model based on the loss function, and determining whether the trained initial image recognition model has converged;

[0026] If yes, the trained initial image recognition model is used as the image recognition model;

[0027] If not, return to continue calculating the loss function based on the next sample discrimination result and the pre-labeled label of the scene image sample corresponding to the sample discrimination result, until the trained initial image recognition model converges or the number of the sample discrimination results obtained reaches the preset number.

[0028] According to the scene recognition method of the present invention, the training of the initial image recognition model based on the loss function includes:

[0029] Obtaining optimization parameters of the initial image recognition model based on the loss function;

[0030] Perform gradient backpropagation on the optimized parameters to update the parameters of the initial image recognition model.

[0031] According to the scene recognition method of the present invention, inputting the scene image sample into the initial image recognition model to obtain the sample discrimination result includes:

[0032] Constructing a queue with a length equal to the preset number;

[0033] The obtained sample discrimination results are sequentially stored in the queue;

[0034] Based on whether the queue is full, it is determined whether the number of the sample discrimination results reaches the preset number.

[0035] According to the scene recognition method of the present invention, after returning to reacquire a new scene image sample, the method further includes:

[0036] The queue is cleared to store new sample discrimination results obtained by inputting the new scene image sample into the trained initial image recognition model.

[0037] The present invention also provides a scene recognition system, comprising:

[0038] An acquisition module, used to acquire scene images;

[0039] a processing module, configured to input the scene image into an image recognition model and output a recognition result based on the scene image;

[0040] The image recognition model is trained based on a sample discrimination result obtained by inputting scene image samples into an initial image recognition model and a sample discrimination result mean obtained by averaging a preset number of the sample discrimination results.

[0041] The present invention also provides a system for identifying the degree of dirtiness of a factory building, which identifies the degree of dirtiness of the factory building based on the monitoring video of the factory building, and includes the scene recognition system as described above.

[0042] The present invention provides a scene recognition method, system and factory dirtiness discrimination system, which obtain a discrimination result based on the scene image by inputting the acquired scene image into an image recognition model. The use of an image recognition model that converts the discrimination results of a preset number of samples into the output of an iterative scene recognition model by taking the average solves the problem that the noise caused by the complexity of the scene and the subjectivity of manual labeling in neat samples has too great an impact on the model effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0044] Figure 1 It is a flow chart of a scene recognition method provided by the present invention;

[0045] Figure 2 This is one of the flow charts of a scene recognition model training method provided by the present invention;

[0046] Figure 3 This is the second flow chart of a scene recognition model training method provided by the present invention;

[0047] Figure 4 It is a structural diagram of a scene recognition system provided by the present invention;

[0048] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0049] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0050] It should be noted that the identification of specific scenes plays a very important role in public security, fire protection, monitoring and other fields.

[0051] Taking scene recognition applied to factory 6S management as an example, it's understandable that 6S management falls under production site management, a crucial component of enterprise management. Managing dirty, messy, and poorly maintained factories is a core aspect of production site management. This is because it involves multiple aspects, including work awareness, system development, and behavioral habits. The fundamental philosophy and concept lies in creating a comfortable working environment, improving employee efficiency, and establishing a positive corporate image. Improving the factory work environment can foster a positive work atmosphere and increase employee productivity; create a clean and tidy work environment and enhance product quality; create an orderly office environment and ensure safe production; and promote self-discipline and a conscientious work attitude among employees, thereby increasing their enthusiasm.

[0052] Current algorithms for identifying dirty and messy factory buildings are primarily based on simple visual classification, requiring extensive manual labeling to accurately label the building. However, in reality, factory scenes are extremely complex, varying significantly between buildings and within the same building over time. Furthermore, manual labeling is highly subjective, and different people have different perceptions of what constitutes dirty and messy conditions, leading to label instability. Consequently, simple visual classification algorithms are unable to efficiently and accurately distinguish between dirty and messy scenes.

[0053] Based on this, an embodiment of the present invention proposes a scene recognition method to avoid the impact of noisy data application caused by scene complexity and subjectivity of manual labeling on the recognition model effect, thereby improving scene recognition accuracy.

[0054] The following combination Figures 1 to 3 A scene recognition method of the present invention is described, which is performed by an image recognition model; Figure 1 As shown, the method includes the following steps:

[0055] 101. Acquire a scene image.

[0056] Specifically, taking the recognition of the degree of dirtiness and disorder in a factory as an example, the scene image can be obtained by extracting it from the surveillance video taken by the surveillance cameras arranged in the factory, or by using a camera installed in the factory to take regular pictures of the factory.

[0057] 102. Input the scene image into an image recognition model to obtain a discrimination result based on the scene image;

[0058] The image recognition model is trained based on a sample discrimination result obtained by inputting scene image samples into an initial image recognition model and a sample discrimination result mean obtained by averaging a preset number of the sample discrimination results.

[0059] It is understandable that the scene recognition model trained with manually annotated labels based on visual classification has the advantages of simple structure and fast running speed, but a large number of manually annotated labels are required during training. The accuracy and number of labels have a direct impact on the effect of the model. However, for scene recognition such as the degree of dirtiness and disorder in a factory, different people have different definitions of the degree of dirtiness and disorder, which directly leads to different labeling by different people. That is, the annotated labels can be understood as containing noise, which makes the model trained based on manually annotated labels not very robust.

[0060] Based on this, the embodiment of the present invention collaboratively trains a scene recognition model through the sample discrimination results and the sample discrimination result mean obtained by averaging a preset number of sample discrimination results, and then uses the scene recognition model to recognize scene images. Without changing the structure and computing speed of the classification model, it effectively overcomes the influence of noise in neat samples on the effect of the scene recognition model, and achieves an improvement in scene recognition accuracy.

[0061] As an embodiment of the present invention, acquiring a scene image includes:

[0062] Get scene video;

[0063] The scene video is extracted frame by frame to obtain the scene image.

[0064] Specifically, cameras are currently widely used in various scenarios. Therefore, in scene recognition, in order to reduce costs, scene videos can be directly obtained from cameras already installed in the scene, and then scene images can be extracted from the scene videos.

[0065] like Figure 2 As shown, as an embodiment of the present invention, a training method of the image recognition model is also included, comprising the following steps:

[0066] 201. Obtain scene image samples;

[0067] 202. Input the scene image sample into the initial image recognition model to obtain the sample discrimination result;

[0068] 203. When the number of the sample discrimination results reaches the preset number, averaging the sample discrimination results to obtain a sample discrimination result mean;

[0069] 204. Calculate a loss function based on each of the sample discrimination results and the mean of the sample discrimination results;

[0070] 205. Training the initial image recognition model based on a loss function;

[0071] 206. Determine whether the trained initial image recognition model has converged; if so, proceed to step 207; if not, return to step 201;

[0072] 207. Use the trained initial image recognition model as the image recognition model.

[0073] Specifically, the initial image recognition model is trained based on a small number of scene image samples and pre-labeled labels. Afterwards, the acquired scene image samples are input into the initial image recognition model to obtain the sample discrimination results. When the number of the sample discrimination results reaches the preset number, the sample discrimination results are averaged to obtain the sample discrimination result mean. The neat pre-labeled labels are converted into the average value of the output results of the first n iterative scene recognition models, which solves the problem that the noise in the noisy neat samples caused by the complexity of the scene and the subjectivity of manual labeling has too much influence on the model effect, making the trained model more accurate.

[0074] More specifically, the initial image recognition model is trained based on the loss function calculated based on the sample discrimination results and the mean of the sample discrimination results, and then it is determined whether the model has converged. If the model has not converged, new scene image samples are reacquired and the model training is continued.

[0075] As an embodiment of the present invention, obtaining a scene image sample includes:

[0076] Extracting scene video samples frame by frame to obtain scene image samples belonging to the same preset scene type;

[0077] The image recognition model is trained based on the sample discrimination results and the mean of the sample discrimination results obtained from the scene image samples belonging to different preset scene types; and the number of each type of scene image samples is comparable.

[0078] Specifically, taking the judgment of whether a factory is dirty and messy as an example, the 6S standard is generally used for judgment, where 6S includes six items: sorting (SEIRI), setting in order (SEITON), cleaning (SEISO), hygiene (SEIKETSU), quality (SHITSUKE), and safety (SAFETY), that is, six categories. Therefore, the scene image samples are trained separately according to their types, which can ensure that the trained scene recognition model can accurately identify scenes of various categories.

[0079] More specifically, by keeping the number of scene image samples of each category comparable, the amount of data for each category can be made roughly the same, thereby ensuring sample balance and solving the bias problem in the scene recognition model training stage.

[0080] As an embodiment of the present invention, before the number of the sample identification results reaches the preset number, the method further includes:

[0081] Calculating a loss function based on the sample discrimination result and a pre-labeled label corresponding to the scene image sample for obtaining the sample discrimination result;

[0082] Training the initial image recognition model based on the loss function, and determining whether the trained initial image recognition model has converged;

[0083] If yes, the trained initial image recognition model is used as the image recognition model;

[0084] If not, return to continue calculating the loss function based on the next sample discrimination result and the pre-labeled label of the scene image sample corresponding to the sample discrimination result, until the trained initial image recognition model converges or the number of the sample discrimination results obtained reaches the preset number.

[0085] Specifically, based on the above embodiment, the training method of the scene recognition model includes the following steps: Figure 3 The specific process shown is:

[0086] 301. Obtain scene image samples;

[0087] 302. Input the scene image sample into the initial image recognition model to obtain the sample discrimination result;

[0088] 303. Determine whether the number of sample identification results reaches the preset number; if so, proceed to step 304; if not, proceed to step 306;

[0089] 304. averaging the sample discrimination results to obtain a sample discrimination result mean;

[0090] 305. After calculating the loss function based on the sample discrimination results and the mean of the sample discrimination results, proceed to step 307;

[0091] 306. Calculate a loss function based on the sample discrimination result and a pre-labeled label corresponding to the scene image sample for obtaining the sample discrimination result;

[0092] 307. Training the initial image recognition model based on a loss function;

[0093] 308. Determine whether the trained initial image recognition model has converged; if so, proceed to step 309; if not, return to step 301;

[0094] 309. Use the trained initial image recognition model as the image recognition model.

[0095] More specifically, in the training method of the scene recognition model described in this embodiment, first, when the number of sample discrimination results has not reached a preset number, the initial image recognition model is trained based on the obtained sample discrimination results and the pre-labeled labels of the scene image samples corresponding to the sample discrimination results. Then, when the sample discrimination results reach a preset number, the initial image recognition model that has been trained with the sample discrimination results and the pre-labeled labels is further trained based on each of the sample discrimination results and the average of the sample discrimination results, thereby realizing dual training of the initial image recognition model. During the training process, the pre-labeled labels of the neat categories are converted into the average value of the sample discrimination results output by the image recognition model for the first n iterations. This not only solves the problem of excessive influence of noise in neat samples on the model effect, but also makes the training faster and the accuracy of the trained scene recognition model higher.

[0096] As an embodiment of the present invention, the training of the initial image recognition model based on the loss function includes:

[0097] Obtaining optimization parameters of the initial image recognition model based on the loss function;

[0098] Perform gradient backpropagation on the optimized parameters to update the parameters of the initial image recognition model.

[0099] Specifically, the parameters of the initial image recognition model are continuously updated through gradient back propagation.

[0100] As an embodiment of the present invention, inputting the scene image sample into the initial image recognition model to obtain the sample discrimination result includes:

[0101] Constructing a queue with a length equal to the preset number;

[0102] The obtained sample discrimination results are sequentially stored in the queue;

[0103] Based on whether the queue is full, it is determined whether the number of the sample discrimination results reaches the preset number.

[0104] Specifically, by constructing a queue with a length equal to the preset number, the sample discrimination results obtained by inputting each scene image sample into the initial scene recognition model are filled into the queue in sequence, which facilitates the judgment of whether the number of sample discrimination results meets the preset number, and further facilitates the uniform batch processing of the sample discrimination results.

[0105] As an embodiment of the present invention, after returning to reacquire a new scene image sample, the method further includes:

[0106] The queue is cleared to store new sample discrimination results obtained by inputting the new scene image sample into the trained initial image recognition model.

[0107] It is understood that the scene recognition method described in the above embodiment of the present invention, based on a semi-supervised classification approach, uniformly addresses the problem of noisy data classification and real-world data imbalance caused by scene complexity and the subjectivity of manual annotation in different scenarios. This method further improves the robustness of the classification network to noisy data fitting, and improves the accuracy of the classification model without reducing the model speed or changing the model structure. It does not affect the model's prediction process, is applicable to various noise-prone scenarios, and is highly scalable.

[0108] A scene recognition system provided by the present invention is described below. The scene recognition system described below and the scene recognition method described above can be referenced to each other.

[0109] like Figure 4 As shown, a scene recognition system provided by the present invention includes: an acquisition module 410 and a processing module 420; wherein,

[0110] The acquisition module 410 is used to acquire scene images;

[0111] The processing module 420 is used to input the scene image into the image recognition model and output a recognition result based on the scene image;

[0112] The image recognition model is trained based on a sample discrimination result obtained by inputting scene image samples into an initial image recognition model and a sample discrimination result mean obtained by averaging a preset number of the sample discrimination results.

[0113] The scene recognition system obtains a discrimination result based on the scene image by inputting the acquired scene image into the image recognition model, wherein the use of the image recognition model that converts the discrimination results of a preset number of samples into the output of the iterative scene recognition model by taking the average solves the problem that the noise caused by the complexity of the scene and the subjectivity of manual labeling in the neat samples has too great an impact on the model effect.

[0114] Preferably, the acquisition module includes an acquisition unit and an extraction unit;

[0115] The acquisition unit is used to acquire scene video;

[0116] The extraction unit is used to extract the scene video frame by frame to obtain the scene image.

[0117] Preferably, the scene recognition system further includes a training system for an image recognition model, comprising: a sample acquisition module, a sample processing module, a calculation module, a training module, and a first judgment module; wherein,

[0118] The sample acquisition module is used to acquire scene image samples;

[0119] The sample processing module is used to input the scene image sample into the initial image recognition model to obtain the sample discrimination result;

[0120] The calculation module is used to average the sample discrimination results when the number of the sample discrimination results reaches the preset number to obtain a sample discrimination result mean, and calculate a loss function based on each of the sample discrimination results and the sample discrimination result mean;

[0121] The training module is used to train the initial image recognition model based on the loss function;

[0122] The first judgment module is used to judge whether the trained initial image recognition model has converged.

[0123] Preferably, the sample acquisition module is specifically used to extract scene video samples frame by frame to obtain the scene image samples belonging to the same preset scene type;

[0124] The image recognition model is trained based on the sample discrimination results and the mean of the sample discrimination results obtained from the scene image samples belonging to different preset scene types; and the number of each type of scene image samples is comparable.

[0125] Preferably, it further includes a second judgment module;

[0126] The second judgment module is used to judge whether the number of the sample judgment results reaches the preset number;

[0127] The calculation module is further configured to calculate a loss function based on the sample identification results and pre-labeled labels of scene image samples corresponding to the sample identification results when the number of the sample identification results does not reach the preset number.

[0128] Preferably, the training module is specifically used to obtain the optimization parameters of the initial image recognition model based on the loss function;

[0129] Perform gradient backpropagation on the optimized parameters to update the parameters of the initial image recognition model.

[0130] Preferably, the processing module includes a construction unit, a storage unit and a judgment unit;

[0131] The construction unit is used to construct a queue with a length equal to the preset number;

[0132] The storage unit is used to store the obtained sample discrimination results in the queue in sequence;

[0133] The judgment unit is configured to judge whether the number of the sample discrimination results reaches the preset number based on whether the queue is full.

[0134] Preferably, the processing module further includes a clearing unit, which is used to clear the queue after returning to reacquire new scene image samples to store new sample discrimination results obtained by inputting the new scene image samples into the trained initial image recognition model.

[0135] The present invention also provides a system for identifying the degree of dirtiness of a factory building, which identifies the degree of dirtiness of the factory building based on the monitoring video of the factory building, and includes the scene recognition system as described above.

[0136] Specifically, the factory building dirtiness identification system including the scene recognition system described in the present invention has all the advantages and technical effects of the scene recognition system, which will not be repeated here.

[0137] Figure 5 An example of a physical structure diagram of an electronic device is shown below. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a scene recognition method, which includes: acquiring a scene image; inputting the scene image into an image recognition model to obtain a discrimination result based on the scene image; wherein the image recognition model is trained based on a sample discrimination result obtained by inputting a scene image sample into an initial image recognition model, and a sample discrimination result average obtained by averaging a preset number of the sample discrimination results.

[0138] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0139] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute a scene recognition method provided by the above methods, the method including: acquiring a scene image; inputting the scene image into an image recognition model to obtain a discrimination result based on the scene image; wherein the image recognition model is trained based on the sample discrimination result obtained by inputting the scene image sample into the initial image recognition model, and the sample discrimination result average obtained by averaging a preset number of the sample discrimination results.

[0140] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform a scene recognition method provided above, the method comprising: acquiring a scene image; inputting the scene image into an image recognition model to obtain a discrimination result based on the scene image; wherein the image recognition model is trained based on the sample discrimination result obtained by inputting the scene image sample into the initial image recognition model, and the average of the sample discrimination results obtained by averaging a preset number of the sample discrimination results.

[0141] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0142] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A scene recognition method, characterized in that: include: Get scene image; Inputting the scene image into an image recognition model to obtain a discrimination result based on the scene image; The image recognition model is trained based on a sample discrimination result obtained by inputting a scene image sample into an initial image recognition model and a sample discrimination result mean obtained by averaging a preset number of the sample discrimination results; The training method of the image recognition model includes: Get scene image samples; Inputting the scene image sample into the initial image recognition model to obtain the sample discrimination result; When the number of the sample discrimination results reaches the preset number, averaging the sample discrimination results to obtain a sample discrimination result mean; Calculating a loss function based on each of the sample discrimination results and the mean of the sample discrimination results; Training the initial image recognition model based on the loss function, and determining whether the trained initial image recognition model has converged; If yes, the trained initial image recognition model is used as the image recognition model; If not, return to reacquire new scene image samples to continue training the trained initial image recognition model.

2. The scene recognition method according to claim 1, characterized in that The acquiring of the scene image comprises: Get scene video; The scene video is extracted frame by frame to obtain the scene image.

3. The scene recognition method according to claim 1, characterized in that The acquiring of scene image samples comprises: Extracting scene video samples frame by frame to obtain scene image samples belonging to the same preset scene type; The image recognition model is trained based on the sample discrimination results and the mean of the sample discrimination results obtained from the scene image samples belonging to different preset scene types; and the number of each type of scene image samples is comparable.

4. The scene recognition method according to claim 3, characterized in that: When the number of the sample identification results reaches the preset number, the method further includes: Calculating a loss function based on the sample discrimination result and a pre-labeled label corresponding to the scene image sample for obtaining the sample discrimination result; Training the initial image recognition model based on the loss function, and determining whether the trained initial image recognition model has converged; If yes, the trained initial image recognition model is used as the image recognition model; If not, return to continue calculating the loss function based on the next sample discrimination result and the pre-labeled label of the scene image sample corresponding to the sample discrimination result, until the trained initial image recognition model converges or the number of the sample discrimination results obtained reaches the preset number.

5. The scene recognition method according to claim 3 or 4, characterized in that: The training of the initial image recognition model based on the loss function includes: Obtaining optimization parameters of the initial image recognition model based on the loss function; Perform gradient backpropagation on the optimized parameters to update the parameters of the initial image recognition model.

6. The scene recognition method according to claim 3, characterized in that: The step of inputting the scene image sample into the initial image recognition model to obtain the sample discrimination result includes: Constructing a queue with a length equal to the preset number; The obtained sample discrimination results are sequentially stored in the queue; Based on whether the queue is full, it is determined whether the number of the sample discrimination results reaches the preset number.

7. The scene recognition method according to claim 6, characterized in that: After returning and reacquiring a new scene image sample, the method further includes: The queue is cleared to store new sample discrimination results obtained by inputting the new scene image sample into the trained initial image recognition model.

8. A scene recognition system, characterized in that: include: An acquisition module, used to acquire scene images; a processing module, configured to input the scene image into an image recognition model and output a recognition result based on the scene image; The image recognition model is trained based on the sample discrimination results obtained by inputting scene image samples into the initial image recognition model and the sample discrimination result mean obtained by averaging a preset number of the sample discrimination results; the training method of the image recognition model includes: Get scene image samples; Inputting the scene image sample into the initial image recognition model to obtain the sample discrimination result; When the number of the sample discrimination results reaches the preset number, averaging the sample discrimination results to obtain a sample discrimination result mean; Calculating a loss function based on each of the sample discrimination results and the mean of the sample discrimination results; Training the initial image recognition model based on the loss function, and determining whether the trained initial image recognition model has converged; If yes, the trained initial image recognition model is used as the image recognition model; If not, return to reacquire new scene image samples to continue training the trained initial image recognition model.

9. A system for identifying the degree of dirtiness of a factory building, which identifies the degree of dirtiness of the factory building based on the monitoring video of the factory building, characterized in that: Comprising the scene recognition system as claimed in claim 8.

Citation Information

Patent Citations

  • Method and system for recognizing indoor and outdoor scenes

    CN104457751A

  • Scene recognition method and device, computer equipment and storage medium

    CN112348117A