1645 words
8 minutes
0
0
An intelligent crop disease detection system powered by YOLO and DeepSeek——一个由 YOLO 和 DeepSeek 驱动的智能农作物病害检测系统
2025-07-28
2025-09-24
NOTE

开源仓库

An intelligent crop disease detection system powered by YOLO and DeepSeek.

YOLO & DeepSeek Powered Crop Disease Detection System(README)#

License: MITPython
Vue.jsSpring Boot

1. Project Overview#

This project is an intelligent crop disease detection system that leverages the powerful YOLO (You Only Look Once) algorithm for real-time object detection. It is built with a modern, decoupled, full-stack architecture, assisted by the DeepSeek AI model for code generation and project insights. The system provides an end-to-end solution for identifying crop diseases from images, videos, and live camera feeds, aiming to offer an efficient and accurate tool for agricultural producers and researchers.

2. Core Features#

  • Multi-source Detection: Supports disease detection from static images, video files, and real-time camera streams.
  • High-Performance Backend: A microservices architecture featuring a Flask server for handling AI model inferences and a Spring Boot server for business logic, data management, and user interactions.
  • Modern Frontend: A responsive and user-friendly web interface built with Vue 3, Vite, and Element Plus.
  • Real-time Communication: Utilizes WebSocket for instant feedback during video processing and ECharts for rich data visualization of detection results.
  • Scalable & Decoupled: The clear separation of frontend, business logic, and AI services allows for independent development, scaling, and maintenance.

3. Technology Stack#

  • Frontend: Vue 3, Vite, Element Plus, Axios, ECharts, Socket.io-client
  • Backend (Business Logic): Java 1.8, Spring Boot, MyBatis-Plus, MySQL/MariaDB, Maven
  • Backend (AI Model): Python, Flask, Ultralytics (YOLO), OpenCV, Flask-SocketIO

4. Application Scenarios#

  • Smart Agriculture: Assists farmers in quickly identifying crop diseases for timely intervention.
  • Agricultural Research: Provides researchers with a tool for automated data collection and analysis of plant pathology.
  • Educational Tool: Serves as a comprehensive full-stack project for developers to learn about integrating AI models with web applications.

5. Installation and Quick Start#

Prerequisites:

  • Node.js >= 16.0
  • Python >= 3.8
  • Java >= 1.8
  • Maven
  • MySQL or MariaDB

Backend Setup (Spring Boot):

  1. Navigate to the YOLO_AI_CropDisease_Detection_SpringBoot directory.
  2. Create a database and import the cropdisease.sql file.
  3. Modify the database connection settings in src/main/resources/application.properties.
  4. Run the application:
Terminal window
mvn spring-boot:run

Backend Setup (Flask AI):

  1. Navigate to the YOLO_AI_CropDisease_Detection_Flask directory.
  2. Install Python dependencies:
Terminal window
pip install -r requirements.txt

   (Note: A requirements.txt file should be created with libraries like ultralytics, flask, opencv-python, requests, flask-socketio)

  1. Download the pre-trained YOLO model weights (e.g., yolo11n.pt) and place them in the weights folder.
  2. Run the AI service:
Terminal window
python main.py

Frontend Setup (Vue):

  1. Navigate to the YOLO_AI_CropDisease_Detection_Vue directory.
  2. Install dependencies:
Terminal window
npm install
  1. Start the development server:
Terminal window
npm run dev
  1. Access the application at the address provided (e.g., http://localhost:3000).

6. Contribution#

Contributions are welcome! Please feel free to submit a Pull Request or open an Issue to report bugs or suggest new features.

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

7. License#

This project is licensed under the MIT License. See the LICENSE file for details.

My_Backup#

Terminal window
conda env list
conda remove -n yolo --all
.venv\Scripts\activate#启动虚拟环境

我的流程

Terminal window
conda create --name yolo python=3.12.4
conda activate yolo
python -m venv .venv
.venv\Scripts\activate
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
python main.py
# SpringBoot
mvn spring-boot:run
# Vue
npm run dev

备份兼容 java17

修改 springboot--- pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>Ece</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Ece</name>
    <description>Ece</description>
    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.7.18</spring-boot.version>
        <lombok.version>1.18.30</lombok.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.1.4</version>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-mqtt</artifactId>
        </dependency>
        <!--        json转对象-->
        <!-- 2020/12/16日最新 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.75</version>
        </dependency>
        <!--mail模板-->
        <!-- springboot 邮件mail -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
            <version>2.6.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>4.2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-util</artifactId>
            <version>9.3.7.v20160115</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>5.7.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.33</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                    <encoding>UTF-8</encoding>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.7.18</version>
                <configuration>
                    <mainClass>com.example.Ece.Ece</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
An intelligent crop disease detection system powered by YOLO and DeepSeek——一个由 YOLO 和 DeepSeek 驱动的智能农作物病害检测系统
https://xieyi.org/posts/an-intelligent-crop-disease-detection-system-powered-by-yolo-and-deepseek一个由-yolo-和-deepseek-驱动的智能农作物病害检测系统/
Author
謝懿Shine
Published at
2025-07-28
License
CC BY-NC-SA 4.0