当前位置:首页>农业>智慧农业yolo+人工智能AI deepseek番茄病害智能检测系统 融合深度学习与大模型的作物视觉诊断平台(SpringBoot+Vue3 架构)

智慧农业yolo+人工智能AI deepseek番茄病害智能检测系统 融合深度学习与大模型的作物视觉诊断平台(SpringBoot+Vue3 架构)

  • 2026-10-19 17:33:47
智慧农业yolo+人工智能AI deepseek番茄病害智能检测系统 融合深度学习与大模型的作物视觉诊断平台(SpringBoot+Vue3 架构)

智慧-YOLO、DeepSeek、PyTorch、SpringBoot – 番茄病害智能检测系统

本系统可精准识别番茄早疫病、晚疫病、霜霉病、灰霉病等常见田间病害,检测识别准确率高达95%以上,识别结果稳定精准、抗干扰能力强。

核心功能

  • 支持田间实拍图片、大棚巡检视频双模式检测,可批量处理作物样本,一键生成专业病害分析报告
  • 贴合现代农业植保标准,AI智能判别病害种类、发病严重程度,自动推送科学用药、田间养护防治方案
  • 系统界面清爽简洁,操作简单零基础上手,精准标记病害区域,病害类型、发病程度全程可视化展示

技术架构
采用YOLO、DeepSeek、PyTorch、SpringBoot、MyBatis-Plus、Vue3、Echarts、TypeScript、Element Plus、Flask、Axios、MySQL主流技术开发搭建。

fu附件:
1.训练完成的YOLO番茄病害专属识别模型
2.全套病害检测完整功能
3.病害智能分析+AI农业植保智能助手


1

1

1

1

1


一、技术架构总览

模块
技术选型
作用
后端
SpringBoot + MyBatis-Plus / Flask
提供API接口、用户管理、数据存储、业务逻辑
前端
Vue3 + TypeScript + Element Plus + Axios
页面交互、数据可视化、用户界面
深度学习
YOLOv8/YOLOv26 + PyTorch
番茄病害目标检测
大模型
DeepSeek(API调用)
病害智能分析、防治建议生成
数据可视化
ECharts
病害统计图表、趋势分析
数据库
MySQL
用户信息、检测记录、系统数据存储

二、项目目录结构 推荐

tomato_disease_system/
├── backend/                # SpringBoot后端
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/com/tomato/
│   │   │   │   ├── controller/    # 控制器
│   │   │   │   ├── service/       # 业务逻辑
│   │   │   │   ├── mapper/        # MyBatis接口
│   │   │   │   ├── entity/        # 实体类
│   │   │   │   └── config/        # 配置类
│   │   │   └── resources/
│   │   │       ├── application.yml # 配置文件
│   │   │       └── mapper/        # SQL映射文件
│   └── pom.xml
├── model_server/           # Flask模型服务
│   ├── app.py              # 模型推理接口
│   ├── requirements.txt
│   └── models/
│       └── tomato_best.pt # 训练好的YOLO模型
├── frontend/               # Vue3前端
│   ├── src/
│   │   ├── components/     # 通用组件
│   │   ├── views/          # 页面
│   │   │   ├── Home.vue    # 首页/上传检测
│   │   │   ├── Camera.vue  # 摄像头检测
│   │   │   ├── History.vue # 历史记录
│   │   │   ├── Analysis.vue # 数据分析
│   │   │   ├── Knowledge.vue # 知识图谱
│   │   │   ├── AIAssistant.vue # AI助手
│   │   │   └── UserManage.vue # 用户管理
│   │   ├── router/        # 路由
│   │   ├── store/          # 状态管理
│   │   └── App.vue
│   └── package.json
└── README.md

三、核心代码实现 【仅供参考学习】

1. Flask 模型服务 model_server/app.py

from flask import Flask, request, jsonify
from ultralytics import YOLO
import cv2
import numpy as np
import base64
import io
from PIL import Image

app = Flask(__name__)
model = YOLO("models/tomato_best.pt")

disease_classes =[
"Healthy","Tomato_Early_blight","Tomato_Late_blight",
"Tomato_Leaf_Mold","Tomato_Septoria_leaf_spot",
"Tomato_Yellow_Leaf_Curl_Virus"
]

@app.route('/detect', methods=['POST'])
defdetect():
    data = request.json
    img_data = base64.b64decode(data['image'])
    img = Image.open(io.BytesIO(img_data)).convert('RGB')
    img = np.array(img)

    results = model(img, conf=0.5)
    detections =[]
for r in results:
for box in r.boxes:
            cls_id =int(box.cls[0])
            disease = disease_classes[cls_id]
            confidence =float(box.conf[0])
            detections.append({
"disease": disease,
"confidence": confidence,
"bbox": box.xyxy[0].tolist()
})
return jsonify({"detections": detections})

if __name__ =='__main__':
    app.run(host='0.0.0.0', port=5001)

2. SpringBoot 后端核心接口 TomatoController.java

packagecom.tomato.controller;

importcom.tomato.entity.DetectionRecord;
importcom.tomato.service.DetectionService;
importorg.springframework.beans.factory.annotation.Autowired;
importorg.springframework.web.bind.annotation.*;
importorg.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/api/detect")
publicclassTomatoController{
@Autowired
privateDetectionService detectionService;

@PostMapping("/upload")
publicStringuploadImage(@RequestParam("file")MultipartFile file){
return detectionService.processAndSave(file);
}

@GetMapping("/history")
publicList<DetectionRecord>getHistory(){
return detectionService.list();
}
}

3. Vue3 前端检测页面 frontend/src/views/Home.vue

<template>
  <div class="upload-page">
    <h1>基于深度学习的番茄病害检测系统</h1>
    <div class="upload-box">
      <input type="file" @change="handleFileUpload" accept="image/*" />
      <button @click="startDetect" class="detect-btn">开始检测</button>
    </div>
    <div class="features">
      <div class="feature-card">
        <h3>快速识别</h3>
        <p>高效识别番茄病害,平台自动高效校验</p>
      </div>
      <div class="feature-card">
        <h3>病害诊断</h3>
        <p>精准识别多种番茄病害,提供专业诊断结果</p>
      </div>
      <div class="feature-card">
        <h3>数据管理</h3>
        <p>历史记录与数据分析,助力科学种植管理</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import axios from 'axios';

const imageFile = ref<File | null>(null);

const handleFileUpload = (e: Event) => {
  const target = e.target as HTMLInputElement;
  if (target.files) {
    imageFile.value = target.files[0];
  }
};

const startDetect = async () => {
  if (!imageFile.value) return;
  const formData = new FormData();
  formData.append('file', imageFile.value);
  await axios.post('/api/detect/upload', formData);
};
</script>

4. YOLOv26 番茄病害模型训练代码

from ultralytics import YOLO

# 训练配置
model = YOLO("yolov26s.pt")
model.train(
    data="tomato_disease.yaml",
    epochs=100,
    imgsz=640,
    batch=8,
    device=0,
    workers=0,
    lr0=0.01,
    patience=15,
    project="tomato_disease_train",
    name="yolov26_tomato"
)

对应的 tomato_disease.yaml:

path: ./tomato_dataset
train: train/images
val: val/images
nc:6
names:
0: Healthy
1: Early_blight
2: Late_blight
3: Leaf_Mold
4: Septoria_leaf_spot
5: Yellow_Leaf_Curl_Virus

四、部署运行步骤

  1. 启动模型服务
    cd model_server
    pip install-r requirements.txt
    python app.py
  2. 启动 SpringBoot 后端
    cd backend
    mvn spring-boot:run
  3. 启动 Vue3 前端
    cd frontend
    npminstall
    npm run dev
  4. 浏览器访问前端地址,即可使用完整系统功能。

五、系统功能说明

功能模块
说明
图片上传检测
上传番茄叶片图片,调用YOLO模型识别病害
摄像头实时检测
调用本地摄像头,实时识别叶片病害并标记
历史记录
查看所有检测记录、置信度、防治建议
数据分析
病害类型分布饼图、趋势折线图、严重程度分析
知识图谱
可视化展示病害症状、传播途径、防治方法
AI助手
基于DeepSeek大模型,解答种植病害相关问题
用户管理
支持管理员/普通用户角色管理,权限控制

六、交付内容说明

✅ 训练完成的YOLO番茄病害专属识别模型(tomato_best.pt)
✅ 全套病害检测完整功能代码(前后端+模型服务)
✅ 病害智能分析+AI农业植保智能助手集成
✅ 一键部署脚本和详细使用说明

千行百业数据集集合专栏(正在更新中);集合直接点击下方蓝字:
无人机类视角航拍数据集合:
无人机类检测数据集(点我)
管道,排水管道缺陷类数据集:
管道缺陷类数据集
火车轨道铁轨类数据集合:
火车轨道安全检测数据集
火灾烟雾类检测数据集
火灾烟雾类数据集
智慧建筑桥梁类数据集合:
建筑桥梁类数据集
智慧电力设备类数据集合:
建筑桥梁类数据集

焊缝钢材缺陷类数据集合

钢材/焊缝缺陷类数据集

光伏电池板类缺陷数据集合:

光伏电池板缺陷检测数据集

智慧农业类叶片虫害等数据集合

智慧农业病虫害类数据集

智慧矿井类数据集合:

煤矿井下类数据集

地质灾害滑坡数据集合

地质灾害滑坡落石数据集

河道巡检漂浮物类数据集合:

水面/河道漂浮物类数据集

智慧工地建筑类数据集合:

建筑工地类数据集

轴承类数据集合

轴承数据集

风力发电叶片缺陷检测数据集合

风力发电类缺陷数据集

船舶类数据集合

船舶类检测数据集

军事类数据集合

军事类检测数据集

道路病害及无人机道路数据集合

道路病害类数据集

数据集正在持续跟新中;
15999元加入超级VIP尊享群,享公众号所有数据集及部分代码,持续更新,永久有效!

最新文章

随机文章